Skip to content

Commit 49a843d

Browse files
committed
2.8 -> 3.0 in specs
1 parent b26b0d6 commit 49a843d

File tree

147 files changed

+199
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+199
-201
lines changed

core/binding/eval_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
bind2.local_variables.should == []
2424
end
2525

26-
ruby_version_is ""..."2.8" do
26+
ruby_version_is ""..."3.0" do
2727
it "inherits __LINE__ from the enclosing scope" do
2828
obj = BindingSpecs::Demo.new(1)
2929
bind = obj.get_binding
@@ -50,7 +50,7 @@
5050
end
5151
end
5252

53-
ruby_version_is "2.8" do
53+
ruby_version_is "3.0" do
5454
it "starts with line 1 if single argument is given" do
5555
obj = BindingSpecs::Demo.new(1)
5656
bind = obj.get_binding
@@ -89,15 +89,15 @@
8989
bind.eval("#foo\n__LINE__", "(test)", 88).should == 89
9090
end
9191

92-
ruby_version_is ""..."2.8" do
92+
ruby_version_is ""..."3.0" do
9393
it "inherits __FILE__ from the enclosing scope" do
9494
obj = BindingSpecs::Demo.new(1)
9595
bind = obj.get_binding
9696
suppress_warning {bind.eval("__FILE__")}.should == obj.get_file_of_binding
9797
end
9898
end
9999

100-
ruby_version_is "2.8" do
100+
ruby_version_is "3.0" do
101101
it "Uses (eval) as __FILE__ if single argument given" do
102102
obj = BindingSpecs::Demo.new(1)
103103
bind = obj.get_binding

core/env/delete_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
ScratchPad.recorded.should == "foo"
3131
end
3232

33-
ruby_version_is "2.8" do
33+
ruby_version_is "3.0" do
3434
it "returns the result of given block if the named environment variable does not exist" do
3535
ENV.delete("foo")
3636
ENV.delete("foo") { |name| "bar" }.should == "bar"

core/exception/no_method_error_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def inspect
104104
end
105105
end
106106

107-
ruby_version_is "2.8" do
107+
ruby_version_is "3.0" do
108108
it "uses #name to display the receiver if it is a class or a module" do
109109
klass = Class.new { def self.name; "MyClass"; end }
110110
begin

core/hash/shared/each.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ary.sort.should == ["a", "b", "c"]
2222
end
2323

24-
ruby_version_is ""..."2.8" do
24+
ruby_version_is ""..."3.0" do
2525
it "yields 2 values and not an Array of 2 elements when given a callable of arity 2" do
2626
obj = Object.new
2727
def obj.foo(key, value)
@@ -38,7 +38,7 @@ def obj.foo(key, value)
3838
end
3939
end
4040

41-
ruby_version_is "2.8" do
41+
ruby_version_is "3.0" do
4242
it "yields an Array of 2 elements when given a callable of arity 2" do
4343
obj = Object.new
4444
def obj.foo(key, value)

core/hash/to_proc_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
@proc = @hash.to_proc
2020
end
2121

22-
ruby_version_is ""..."2.8" do
22+
ruby_version_is ""..."3.0" do
2323
it "is not a lambda" do
2424
@proc.should_not.lambda?
2525
end
2626
end
2727

28-
ruby_version_is "2.8" do
28+
ruby_version_is "3.0" do
2929
it "is a lambda" do
3030
@proc.should.lambda?
3131
end

core/io/shared/new.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
@io.internal_encoding.to_s.should == 'IBM866'
198198
end
199199

200-
ruby_version_is ''...'2.8' do
200+
ruby_version_is ''...'3.0' do
201201
it "accepts nil options" do
202202
@io = suppress_keyword_warning do
203203
IO.send(@method, @fd, 'w', nil)
@@ -206,7 +206,7 @@
206206
end
207207
end
208208

209-
ruby_version_is '2.8' do
209+
ruby_version_is '3.0' do
210210
it "raises ArgumentError for nil options" do
211211
-> {
212212
IO.send(@method, @fd, 'w', nil)
@@ -382,7 +382,7 @@
382382
}.should raise_error(ArgumentError)
383383
end
384384

385-
ruby_version_is ''...'2.8' do
385+
ruby_version_is ''...'3.0' do
386386
it "raises TypeError if passed a hash for mode and nil for options" do
387387
-> {
388388
suppress_keyword_warning do
@@ -392,7 +392,7 @@
392392
end
393393
end
394394

395-
ruby_version_is '2.8' do
395+
ruby_version_is '3.0' do
396396
it "raises ArgumentError if passed a hash for mode and nil for options" do
397397
-> {
398398
@io = IO.send(@method, @fd, {mode: 'w'}, nil)

core/io/ungetc_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@
103103
-> { @io.sysread(1) }.should raise_error(IOError)
104104
end
105105

106-
ruby_version_is "0"..."2.8" do
106+
ruby_version_is "0"..."3.0" do
107107
it "does not affect the stream and returns nil when passed nil" do
108108
@io.getc.should == ?V
109109
@io.ungetc(nil)
110110
@io.getc.should == ?o
111111
end
112112
end
113113

114-
ruby_version_is "2.8" do
114+
ruby_version_is "3.0" do
115115
it "raises TypeError if passed nil" do
116116
@io.getc.should == ?V
117117
proc{@io.ungetc(nil)}.should raise_error(TypeError)

core/kernel/__dir___spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
end
2020
end
2121

22-
ruby_version_is ""..."2.8" do
22+
ruby_version_is ""..."3.0" do
2323
context "when used in eval with top level binding" do
2424
it "returns the real name of the directory containing the currently-executing file" do
2525
eval("__dir__", binding).should == File.realpath(File.dirname(__FILE__))
2626
end
2727
end
2828
end
2929

30-
ruby_version_is "2.8" do
30+
ruby_version_is "3.0" do
3131
context "when used in eval with top level binding" do
3232
it "returns nil" do
3333
eval("__dir__", binding).should == nil

core/kernel/clone_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def klass.allocate
3737
o3.should.frozen?
3838
end
3939

40-
ruby_version_is '2.8' do
40+
ruby_version_is '3.0' do
4141
it 'takes an freeze: true option to frozen copy' do
4242
@obj.clone(freeze: true).should.frozen?
4343
@obj.freeze

core/kernel/eval_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class Object
159159
end
160160
end
161161

162-
ruby_version_is ""..."2.8" do
162+
ruby_version_is ""..."3.0" do
163163
it "uses the filename of the binding if none is provided" do
164164
eval("__FILE__").should == "(eval)"
165165
suppress_warning {eval("__FILE__", binding)}.should == __FILE__
@@ -170,7 +170,7 @@ class Object
170170
end
171171
end
172172

173-
ruby_version_is "2.8" do
173+
ruby_version_is "3.0" do
174174
it "uses (eval) filename if none is provided" do
175175
eval("__FILE__").should == "(eval)"
176176
eval("__FILE__", binding).should == "(eval)"

core/kernel/iterator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative '../../spec_helper'
22
require_relative 'fixtures/classes'
33

4-
ruby_version_is ""..."2.8" do
4+
ruby_version_is ""..."3.0" do
55
describe "Kernel#iterator?" do
66
it "is a private method" do
77
Kernel.should have_private_instance_method(:iterator?)

core/kernel/proc_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ def some_method
4848
end
4949
end
5050

51-
ruby_version_is "2.7"..."2.8" do
51+
ruby_version_is "2.7"..."3.0" do
5252
it "can be created when called with no block" do
5353
-> {
5454
some_method { "hello" }
5555
}.should complain(/Capturing the given block using Kernel#proc is deprecated/)
5656
end
5757
end
5858

59-
ruby_version_is "2.8" do
59+
ruby_version_is "3.0" do
6060
it "raises an ArgumentError when passed no block" do
6161
-> {
6262
some_method { "hello" }

core/kernel/shared/require.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
ScratchPad.recorded.should == [:loaded]
244244
end
245245

246-
ruby_bug "#16926", "2.7"..."2.8" do
246+
ruby_bug "#16926", "2.7"..."3.0" do
247247
it "does not load a feature twice when $LOAD_PATH has been modified" do
248248
$LOAD_PATH.replace [CODE_LOADING_DIR]
249249
@object.require("load_fixture").should be_true

core/method/compose_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def double.call(n); n * 2; end
3939
double = proc { |x| x + x }
4040

4141
(pow_2 << double).is_a?(Proc).should == true
42-
ruby_version_is(''...'2.8') { (pow_2 << double).should.lambda? }
43-
ruby_version_is('2.8') { (pow_2 << double).should_not.lambda? }
42+
ruby_version_is(''...'3.0') { (pow_2 << double).should.lambda? }
43+
ruby_version_is('3.0') { (pow_2 << double).should_not.lambda? }
4444
end
4545

4646
it "may accept multiple arguments" do

core/method/shared/to_s.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@string.should =~ /MethodSpecs::MySub/
3333
end
3434

35-
ruby_version_is '2.8' do
35+
ruby_version_is '3.0' do
3636
it "returns a String containing the Module containing the method if object has a singleton class but method is not defined in the singleton class" do
3737
obj = MethodSpecs::MySub.new
3838
obj.singleton_class

core/module/prepend_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def self.prepend_features(mod)
128128
c.dup.new.should be_kind_of(m)
129129
end
130130

131-
ruby_version_is '0'...'2.8' do
131+
ruby_version_is '0'...'3.0' do
132132
it "keeps the module in the chain when dupping an intermediate module" do
133133
m1 = Module.new { def calc(x) x end }
134134
m2 = Module.new { prepend(m1) }
@@ -143,7 +143,7 @@ def self.prepend_features(mod)
143143
end
144144
end
145145

146-
ruby_version_is '2.8' do
146+
ruby_version_is '3.0' do
147147
it "uses only new module when dupping the module" do
148148
m1 = Module.new { def calc(x) x end }
149149
m2 = Module.new { prepend(m1) }

core/module/refine_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ def foo
980980
result.should == [:B, :A, :LAST, :C]
981981
end
982982

983-
ruby_version_is ""..."2.8" do
983+
ruby_version_is ""..."3.0" do
984984
it "looks in the lexical scope refinements before other active refinements" do
985985
refined_class = ModuleSpecs.build_refined_class(for_super: true)
986986

@@ -1016,7 +1016,7 @@ def foo
10161016
end
10171017
end
10181018

1019-
ruby_version_is "2.8" do
1019+
ruby_version_is "3.0" do
10201020
# https://bugs.ruby-lang.org/issues/17007
10211021
it "does not look in the lexical scope refinements before other active refinements" do
10221022
refined_class = ModuleSpecs.build_refined_class(for_super: true)

core/mutex/owned_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
end
4242
end
4343

44-
ruby_version_is "2.8" do
44+
ruby_version_is "3.0" do
4545
it "is held per Fiber" do
4646
m = Mutex.new
4747
m.lock

core/proc/compose_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def double.call(n); n * 2; end
3838
(f << g).should_not.lambda?
3939
end
4040

41-
ruby_version_is(''...'2.8') do
41+
ruby_version_is(''...'3.0') do
4242
it "is a Proc when other is lambda" do
4343
f = proc { |x| x * x }
4444
g = -> x { x + x }
@@ -56,7 +56,7 @@ def double.call(n); n * 2; end
5656
end
5757
end
5858

59-
ruby_version_is('2.8') do
59+
ruby_version_is('3.0') do
6060
it "is a lambda when parameter is lambda" do
6161
f = -> x { x * x }
6262
g = proc { |x| x + x }

core/proc/eql_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
require_relative 'shared/equal'
33

44
describe "Proc#eql?" do
5-
ruby_version_is "0"..."2.8" do
5+
ruby_version_is "0"..."3.0" do
66
it_behaves_like :proc_equal_undefined, :eql?
77
end
88

9-
ruby_version_is "2.8" do
9+
ruby_version_is "3.0" do
1010
it_behaves_like :proc_equal, :eql?
1111
end
1212
end

core/proc/equal_value_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
require_relative 'shared/equal'
33

44
describe "Proc#==" do
5-
ruby_version_is "0"..."2.8" do
5+
ruby_version_is "0"..."3.0" do
66
it_behaves_like :proc_equal_undefined, :==
77
end
88

9-
ruby_version_is "2.8" do
9+
ruby_version_is "3.0" do
1010
it_behaves_like :proc_equal, :==
1111
end
1212
end

core/proc/new_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def some_method
203203
end
204204
end
205205

206-
ruby_version_is "2.7"..."2.8" do
206+
ruby_version_is "2.7"..."3.0" do
207207
it "can be created if invoked from within a method with a block" do
208208
-> { ProcSpecs.new_proc_in_method { "hello" } }.should complain(/Capturing the given block using Proc.new is deprecated/)
209209
end
@@ -224,7 +224,7 @@ def some_method
224224
end
225225
end
226226

227-
ruby_version_is "2.8" do
227+
ruby_version_is "3.0" do
228228
it "raises an ArgumentError when passed no block" do
229229
def some_method
230230
Proc.new

core/regexp/initialize_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Regexp.should have_private_method(:initialize)
66
end
77

8-
ruby_version_is ""..."2.8" do
8+
ruby_version_is ""..."3.0" do
99
it "raises a SecurityError on a Regexp literal" do
1010
-> { //.send(:initialize, "") }.should raise_error(SecurityError)
1111
end
1212
end
1313

14-
ruby_version_is "2.8" do
14+
ruby_version_is "3.0" do
1515
it "raises a FrozenError on a Regexp literal" do
1616
-> { //.send(:initialize, "") }.should raise_error(FrozenError)
1717
end

core/symbol/to_proc_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
:to_s.to_proc.call(obj).should == "Received #to_s"
1313
end
1414

15-
ruby_version_is ""..."2.8" do
15+
ruby_version_is ""..."3.0" do
1616
it "returns a Proc with #lambda? false" do
1717
pr = :to_s.to_proc
1818
pr.should_not.lambda?
@@ -29,7 +29,7 @@
2929
end
3030
end
3131

32-
ruby_version_is "2.8" do
32+
ruby_version_is "3.0" do
3333
it "returns a Proc with #lambda? true" do
3434
pr = :to_s.to_proc
3535
pr.should.lambda?

core/thread/exclusive_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require_relative '../../spec_helper'
22

3-
ruby_version_is ''...'2.8' do
3+
ruby_version_is ''...'3.0' do
44
describe "Thread.exclusive" do
55
before :each do
66
ScratchPad.clear

0 commit comments

Comments
 (0)