Skip to content

Commit 5042149

Browse files
andrykonchineregon
authored andcommitted
Remove version guards for 3.2
1 parent 95cf2ba commit 5042149

File tree

164 files changed

+3368
-4611
lines changed

Some content is hidden

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

164 files changed

+3368
-4611
lines changed

core/array/pack/shared/basic.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,7 @@
3232
[@obj, @obj, @obj, @obj].pack("aa #{pack_format} # some comment \n#{pack_format}").should be_an_instance_of(String)
3333
end
3434

35-
ruby_version_is ""..."3.2" do
36-
it "warns in verbose mode that a directive is unknown" do
37-
# additional directive ('a') is required for the X directive
38-
-> { [@obj, @obj].pack("a R" + pack_format) }.should complain(/unknown pack directive 'R'/, verbose: true)
39-
-> { [@obj, @obj].pack("a 0" + pack_format) }.should complain(/unknown pack directive '0'/, verbose: true)
40-
-> { [@obj, @obj].pack("a :" + pack_format) }.should complain(/unknown pack directive ':'/, verbose: true)
41-
end
42-
end
43-
44-
ruby_version_is "3.2"..."3.3" do
35+
ruby_version_is ""..."3.3" do
4536
# https://bugs.ruby-lang.org/issues/19150
4637
# NOTE: it's just a plan of the Ruby core team
4738
it "warns that a directive is unknown" do

core/array/shared/slice.rb

Lines changed: 91 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -754,99 +754,97 @@ def to.to_int() -2 end
754754
a.send(@method, (...-9)).should == []
755755
end
756756

757-
ruby_version_is "3.2" do
758-
describe "can be sliced with Enumerator::ArithmeticSequence" do
759-
it "with infinite/inverted ranges and negative steps" do
760-
@array = [0, 1, 2, 3, 4, 5]
761-
@array.send(@method, (2..).step(-1)).should == [2, 1, 0]
762-
@array.send(@method, (2..).step(-2)).should == [2, 0]
763-
@array.send(@method, (2..).step(-3)).should == [2]
764-
@array.send(@method, (2..).step(-4)).should == [2]
765-
766-
@array.send(@method, (-3..).step(-1)).should == [3, 2, 1, 0]
767-
@array.send(@method, (-3..).step(-2)).should == [3, 1]
768-
@array.send(@method, (-3..).step(-3)).should == [3, 0]
769-
@array.send(@method, (-3..).step(-4)).should == [3]
770-
@array.send(@method, (-3..).step(-5)).should == [3]
771-
772-
@array.send(@method, (..0).step(-1)).should == [5, 4, 3, 2, 1, 0]
773-
@array.send(@method, (..0).step(-2)).should == [5, 3, 1]
774-
@array.send(@method, (..0).step(-3)).should == [5, 2]
775-
@array.send(@method, (..0).step(-4)).should == [5, 1]
776-
@array.send(@method, (..0).step(-5)).should == [5, 0]
777-
@array.send(@method, (..0).step(-6)).should == [5]
778-
@array.send(@method, (..0).step(-7)).should == [5]
779-
780-
@array.send(@method, (...0).step(-1)).should == [5, 4, 3, 2, 1]
781-
@array.send(@method, (...0).step(-2)).should == [5, 3, 1]
782-
@array.send(@method, (...0).step(-3)).should == [5, 2]
783-
@array.send(@method, (...0).step(-4)).should == [5, 1]
784-
@array.send(@method, (...0).step(-5)).should == [5]
785-
@array.send(@method, (...0).step(-6)).should == [5]
786-
787-
@array.send(@method, (...1).step(-1)).should == [5, 4, 3, 2]
788-
@array.send(@method, (...1).step(-2)).should == [5, 3]
789-
@array.send(@method, (...1).step(-3)).should == [5, 2]
790-
@array.send(@method, (...1).step(-4)).should == [5]
791-
@array.send(@method, (...1).step(-5)).should == [5]
792-
793-
@array.send(@method, (..-5).step(-1)).should == [5, 4, 3, 2, 1]
794-
@array.send(@method, (..-5).step(-2)).should == [5, 3, 1]
795-
@array.send(@method, (..-5).step(-3)).should == [5, 2]
796-
@array.send(@method, (..-5).step(-4)).should == [5, 1]
797-
@array.send(@method, (..-5).step(-5)).should == [5]
798-
@array.send(@method, (..-5).step(-6)).should == [5]
799-
800-
@array.send(@method, (...-5).step(-1)).should == [5, 4, 3, 2]
801-
@array.send(@method, (...-5).step(-2)).should == [5, 3]
802-
@array.send(@method, (...-5).step(-3)).should == [5, 2]
803-
@array.send(@method, (...-5).step(-4)).should == [5]
804-
@array.send(@method, (...-5).step(-5)).should == [5]
805-
806-
@array.send(@method, (4..1).step(-1)).should == [4, 3, 2, 1]
807-
@array.send(@method, (4..1).step(-2)).should == [4, 2]
808-
@array.send(@method, (4..1).step(-3)).should == [4, 1]
809-
@array.send(@method, (4..1).step(-4)).should == [4]
810-
@array.send(@method, (4..1).step(-5)).should == [4]
811-
812-
@array.send(@method, (4...1).step(-1)).should == [4, 3, 2]
813-
@array.send(@method, (4...1).step(-2)).should == [4, 2]
814-
@array.send(@method, (4...1).step(-3)).should == [4]
815-
@array.send(@method, (4...1).step(-4)).should == [4]
816-
817-
@array.send(@method, (-2..1).step(-1)).should == [4, 3, 2, 1]
818-
@array.send(@method, (-2..1).step(-2)).should == [4, 2]
819-
@array.send(@method, (-2..1).step(-3)).should == [4, 1]
820-
@array.send(@method, (-2..1).step(-4)).should == [4]
821-
@array.send(@method, (-2..1).step(-5)).should == [4]
822-
823-
@array.send(@method, (-2...1).step(-1)).should == [4, 3, 2]
824-
@array.send(@method, (-2...1).step(-2)).should == [4, 2]
825-
@array.send(@method, (-2...1).step(-3)).should == [4]
826-
@array.send(@method, (-2...1).step(-4)).should == [4]
827-
828-
@array.send(@method, (4..-5).step(-1)).should == [4, 3, 2, 1]
829-
@array.send(@method, (4..-5).step(-2)).should == [4, 2]
830-
@array.send(@method, (4..-5).step(-3)).should == [4, 1]
831-
@array.send(@method, (4..-5).step(-4)).should == [4]
832-
@array.send(@method, (4..-5).step(-5)).should == [4]
833-
834-
@array.send(@method, (4...-5).step(-1)).should == [4, 3, 2]
835-
@array.send(@method, (4...-5).step(-2)).should == [4, 2]
836-
@array.send(@method, (4...-5).step(-3)).should == [4]
837-
@array.send(@method, (4...-5).step(-4)).should == [4]
838-
839-
@array.send(@method, (-2..-5).step(-1)).should == [4, 3, 2, 1]
840-
@array.send(@method, (-2..-5).step(-2)).should == [4, 2]
841-
@array.send(@method, (-2..-5).step(-3)).should == [4, 1]
842-
@array.send(@method, (-2..-5).step(-4)).should == [4]
843-
@array.send(@method, (-2..-5).step(-5)).should == [4]
844-
845-
@array.send(@method, (-2...-5).step(-1)).should == [4, 3, 2]
846-
@array.send(@method, (-2...-5).step(-2)).should == [4, 2]
847-
@array.send(@method, (-2...-5).step(-3)).should == [4]
848-
@array.send(@method, (-2...-5).step(-4)).should == [4]
849-
end
757+
describe "can be sliced with Enumerator::ArithmeticSequence" do
758+
it "with infinite/inverted ranges and negative steps" do
759+
@array = [0, 1, 2, 3, 4, 5]
760+
@array.send(@method, (2..).step(-1)).should == [2, 1, 0]
761+
@array.send(@method, (2..).step(-2)).should == [2, 0]
762+
@array.send(@method, (2..).step(-3)).should == [2]
763+
@array.send(@method, (2..).step(-4)).should == [2]
764+
765+
@array.send(@method, (-3..).step(-1)).should == [3, 2, 1, 0]
766+
@array.send(@method, (-3..).step(-2)).should == [3, 1]
767+
@array.send(@method, (-3..).step(-3)).should == [3, 0]
768+
@array.send(@method, (-3..).step(-4)).should == [3]
769+
@array.send(@method, (-3..).step(-5)).should == [3]
770+
771+
@array.send(@method, (..0).step(-1)).should == [5, 4, 3, 2, 1, 0]
772+
@array.send(@method, (..0).step(-2)).should == [5, 3, 1]
773+
@array.send(@method, (..0).step(-3)).should == [5, 2]
774+
@array.send(@method, (..0).step(-4)).should == [5, 1]
775+
@array.send(@method, (..0).step(-5)).should == [5, 0]
776+
@array.send(@method, (..0).step(-6)).should == [5]
777+
@array.send(@method, (..0).step(-7)).should == [5]
778+
779+
@array.send(@method, (...0).step(-1)).should == [5, 4, 3, 2, 1]
780+
@array.send(@method, (...0).step(-2)).should == [5, 3, 1]
781+
@array.send(@method, (...0).step(-3)).should == [5, 2]
782+
@array.send(@method, (...0).step(-4)).should == [5, 1]
783+
@array.send(@method, (...0).step(-5)).should == [5]
784+
@array.send(@method, (...0).step(-6)).should == [5]
785+
786+
@array.send(@method, (...1).step(-1)).should == [5, 4, 3, 2]
787+
@array.send(@method, (...1).step(-2)).should == [5, 3]
788+
@array.send(@method, (...1).step(-3)).should == [5, 2]
789+
@array.send(@method, (...1).step(-4)).should == [5]
790+
@array.send(@method, (...1).step(-5)).should == [5]
791+
792+
@array.send(@method, (..-5).step(-1)).should == [5, 4, 3, 2, 1]
793+
@array.send(@method, (..-5).step(-2)).should == [5, 3, 1]
794+
@array.send(@method, (..-5).step(-3)).should == [5, 2]
795+
@array.send(@method, (..-5).step(-4)).should == [5, 1]
796+
@array.send(@method, (..-5).step(-5)).should == [5]
797+
@array.send(@method, (..-5).step(-6)).should == [5]
798+
799+
@array.send(@method, (...-5).step(-1)).should == [5, 4, 3, 2]
800+
@array.send(@method, (...-5).step(-2)).should == [5, 3]
801+
@array.send(@method, (...-5).step(-3)).should == [5, 2]
802+
@array.send(@method, (...-5).step(-4)).should == [5]
803+
@array.send(@method, (...-5).step(-5)).should == [5]
804+
805+
@array.send(@method, (4..1).step(-1)).should == [4, 3, 2, 1]
806+
@array.send(@method, (4..1).step(-2)).should == [4, 2]
807+
@array.send(@method, (4..1).step(-3)).should == [4, 1]
808+
@array.send(@method, (4..1).step(-4)).should == [4]
809+
@array.send(@method, (4..1).step(-5)).should == [4]
810+
811+
@array.send(@method, (4...1).step(-1)).should == [4, 3, 2]
812+
@array.send(@method, (4...1).step(-2)).should == [4, 2]
813+
@array.send(@method, (4...1).step(-3)).should == [4]
814+
@array.send(@method, (4...1).step(-4)).should == [4]
815+
816+
@array.send(@method, (-2..1).step(-1)).should == [4, 3, 2, 1]
817+
@array.send(@method, (-2..1).step(-2)).should == [4, 2]
818+
@array.send(@method, (-2..1).step(-3)).should == [4, 1]
819+
@array.send(@method, (-2..1).step(-4)).should == [4]
820+
@array.send(@method, (-2..1).step(-5)).should == [4]
821+
822+
@array.send(@method, (-2...1).step(-1)).should == [4, 3, 2]
823+
@array.send(@method, (-2...1).step(-2)).should == [4, 2]
824+
@array.send(@method, (-2...1).step(-3)).should == [4]
825+
@array.send(@method, (-2...1).step(-4)).should == [4]
826+
827+
@array.send(@method, (4..-5).step(-1)).should == [4, 3, 2, 1]
828+
@array.send(@method, (4..-5).step(-2)).should == [4, 2]
829+
@array.send(@method, (4..-5).step(-3)).should == [4, 1]
830+
@array.send(@method, (4..-5).step(-4)).should == [4]
831+
@array.send(@method, (4..-5).step(-5)).should == [4]
832+
833+
@array.send(@method, (4...-5).step(-1)).should == [4, 3, 2]
834+
@array.send(@method, (4...-5).step(-2)).should == [4, 2]
835+
@array.send(@method, (4...-5).step(-3)).should == [4]
836+
@array.send(@method, (4...-5).step(-4)).should == [4]
837+
838+
@array.send(@method, (-2..-5).step(-1)).should == [4, 3, 2, 1]
839+
@array.send(@method, (-2..-5).step(-2)).should == [4, 2]
840+
@array.send(@method, (-2..-5).step(-3)).should == [4, 1]
841+
@array.send(@method, (-2..-5).step(-4)).should == [4]
842+
@array.send(@method, (-2..-5).step(-5)).should == [4]
843+
844+
@array.send(@method, (-2...-5).step(-1)).should == [4, 3, 2]
845+
@array.send(@method, (-2...-5).step(-2)).should == [4, 2]
846+
@array.send(@method, (-2...-5).step(-3)).should == [4]
847+
@array.send(@method, (-2...-5).step(-4)).should == [4]
850848
end
851849
end
852850

core/class/attached_object_spec.rb

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
require_relative '../../spec_helper'
22

3-
ruby_version_is '3.2' do
4-
describe "Class#attached_object" do
5-
it "returns the object that is attached to a singleton class" do
6-
a = Class.new
3+
describe "Class#attached_object" do
4+
it "returns the object that is attached to a singleton class" do
5+
a = Class.new
76

8-
a_obj = a.new
9-
a_obj.singleton_class.attached_object.should == a_obj
10-
end
7+
a_obj = a.new
8+
a_obj.singleton_class.attached_object.should == a_obj
9+
end
1110

12-
it "returns the class object that is attached to a class's singleton class" do
13-
a = Class.new
14-
singleton_class = (class << a; self; end)
11+
it "returns the class object that is attached to a class's singleton class" do
12+
a = Class.new
13+
singleton_class = (class << a; self; end)
1514

16-
singleton_class.attached_object.should == a
17-
end
15+
singleton_class.attached_object.should == a
16+
end
1817

19-
it "raises TypeError if the class is not a singleton class" do
20-
a = Class.new
18+
it "raises TypeError if the class is not a singleton class" do
19+
a = Class.new
2120

22-
-> { a.attached_object }.should raise_error(TypeError, /is not a singleton class/)
23-
end
21+
-> { a.attached_object }.should raise_error(TypeError, /is not a singleton class/)
22+
end
2423

25-
it "raises TypeError for special singleton classes" do
26-
-> { nil.singleton_class.attached_object }.should raise_error(TypeError, /[`']NilClass' is not a singleton class/)
27-
-> { true.singleton_class.attached_object }.should raise_error(TypeError, /[`']TrueClass' is not a singleton class/)
28-
-> { false.singleton_class.attached_object }.should raise_error(TypeError, /[`']FalseClass' is not a singleton class/)
29-
end
24+
it "raises TypeError for special singleton classes" do
25+
-> { nil.singleton_class.attached_object }.should raise_error(TypeError, /[`']NilClass' is not a singleton class/)
26+
-> { true.singleton_class.attached_object }.should raise_error(TypeError, /[`']TrueClass' is not a singleton class/)
27+
-> { false.singleton_class.attached_object }.should raise_error(TypeError, /[`']FalseClass' is not a singleton class/)
3028
end
3129
end

core/complex/polar_spec.rb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@
1111
->{ Complex.polar(nil, nil) }.should raise_error(TypeError)
1212
end
1313

14-
ruby_bug "#19004", ""..."3.2" do
15-
it "computes the real values of the real & imaginary parts from the polar form" do
16-
a = Complex.polar(1.0+0.0i, Math::PI/2+0.0i)
17-
a.real.should be_close(0.0, TOLERANCE)
18-
a.imag.should be_close(1.0, TOLERANCE)
19-
a.real.real?.should be_true
20-
a.imag.real?.should be_true
14+
it "computes the real values of the real & imaginary parts from the polar form" do
15+
a = Complex.polar(1.0+0.0i, Math::PI/2+0.0i)
16+
a.real.should be_close(0.0, TOLERANCE)
17+
a.imag.should be_close(1.0, TOLERANCE)
18+
a.real.real?.should be_true
19+
a.imag.real?.should be_true
2120

22-
b = Complex.polar(1+0.0i)
23-
b.real.should be_close(1.0, TOLERANCE)
24-
b.imag.should be_close(0.0, TOLERANCE)
25-
b.real.real?.should be_true
26-
b.imag.real?.should be_true
27-
end
21+
b = Complex.polar(1+0.0i)
22+
b.real.should be_close(1.0, TOLERANCE)
23+
b.imag.should be_close(0.0, TOLERANCE)
24+
b.real.real?.should be_true
25+
b.imag.real?.should be_true
2826
end
2927
end
3028

core/data/constants_spec.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
require_relative '../../spec_helper'
22

3-
ruby_version_is ''...'3.2' do
4-
describe "Data" do
5-
it "does not exist anymore" do
6-
Object.should_not have_constant(:Data)
7-
end
3+
describe "Data" do
4+
it "is a new constant" do
5+
Data.superclass.should == Object
86
end
9-
end
10-
11-
ruby_version_is '3.2' do
12-
describe "Data" do
13-
it "is a new constant" do
14-
Data.superclass.should == Object
15-
end
167

17-
it "is not deprecated" do
18-
-> { Data }.should_not complain
19-
end
8+
it "is not deprecated" do
9+
-> { Data }.should_not complain
2010
end
2111
end

0 commit comments

Comments
 (0)