diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-08 19:43:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-04-01 15:36:20 +0900 |
commit | 826f44834fe11f3f9c52343443a15b6c83466889 (patch) | |
tree | f2c2abed62db1c750515cd8b0fbac6442b6d4200 /spec/ruby/optional | |
parent | 3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (diff) | |
download | ruby-826f44834fe11f3f9c52343443a15b6c83466889.tar.gz |
Drop support for ruby 2.4 from ruby/spec
Diffstat (limited to 'spec/ruby/optional')
-rw-r--r-- | spec/ruby/optional/capi/constants_spec.rb | 19 | ||||
-rw-r--r-- | spec/ruby/optional/capi/numeric_spec.rb | 23 | ||||
-rw-r--r-- | spec/ruby/optional/capi/time_spec.rb | 84 |
3 files changed, 50 insertions, 76 deletions
diff --git a/spec/ruby/optional/capi/constants_spec.rb b/spec/ruby/optional/capi/constants_spec.rb index 3d7f0cebd6..172d10a788 100644 --- a/spec/ruby/optional/capi/constants_spec.rb +++ b/spec/ruby/optional/capi/constants_spec.rb @@ -31,12 +31,6 @@ describe "C-API constant" do @s.rb_mComparable.should == Comparable end - ruby_version_is ""..."2.5" do - specify "rb_cData references the Data class" do - @s.rb_cData.should == Data - end - end - specify "rb_cDir references the Dir class" do @s.rb_cDir.should == Dir end @@ -89,11 +83,8 @@ describe "C-API constant" do @s.rb_mKernel.should == Kernel end - # On 2.4 with require 'mathn', Math is redefined as CMath - ruby_version_is "2.5" do - specify "rb_mMath references the Math module" do - @s.rb_mMath.should == Math - end + specify "rb_mMath references the Math module" do + @s.rb_mMath.should == Math end specify "rb_cMatch references the MatchData class" do @@ -216,10 +207,8 @@ describe "C-API exception constant" do @s.rb_eFloatDomainError.should == FloatDomainError end - ruby_version_is "2.5" do - specify "rb_eFrozenError references the FrozenError class" do - @s.rb_eFrozenError.should == FrozenError - end + specify "rb_eFrozenError references the FrozenError class" do + @s.rb_eFrozenError.should == FrozenError end specify "rb_eIndexError references the IndexError class" do diff --git a/spec/ruby/optional/capi/numeric_spec.rb b/spec/ruby/optional/capi/numeric_spec.rb index de7e180414..d433d19274 100644 --- a/spec/ruby/optional/capi/numeric_spec.rb +++ b/spec/ruby/optional/capi/numeric_spec.rb @@ -437,23 +437,12 @@ describe "CApiNumericSpecs" do @s.rb_num_coerce_cmp(2, obj, :<=>).should == -1 end - ruby_version_is ""..."2.5" do - it "returns nil if passed nil" do - -> { - @result = @s.rb_num_coerce_cmp(nil, 2, :<=>) - }.should complain(/comparison operators will no more rescue exceptions/) - @result.should be_nil - end - end - - ruby_version_is "2.5" do - it "lets the exception go through if #coerce raises an exception" do - obj = mock("rb_num_coerce_cmp") - obj.should_receive(:coerce).with(2).and_raise(RuntimeError.new("my error")) - -> { - @s.rb_num_coerce_cmp(2, obj, :<=>) - }.should raise_error(RuntimeError, "my error") - end + it "lets the exception go through if #coerce raises an exception" do + obj = mock("rb_num_coerce_cmp") + obj.should_receive(:coerce).with(2).and_raise(RuntimeError.new("my error")) + -> { + @s.rb_num_coerce_cmp(2, obj, :<=>) + }.should raise_error(RuntimeError, "my error") end it "returns nil if #coerce does not return an Array" do diff --git a/spec/ruby/optional/capi/time_spec.rb b/spec/ruby/optional/capi/time_spec.rb index 2c824bb566..579e81fc19 100644 --- a/spec/ruby/optional/capi/time_spec.rb +++ b/spec/ruby/optional/capi/time_spec.rb @@ -165,30 +165,28 @@ describe "CApiTimeSpecs" do usec.should == 500000 end - guard -> { platform_is_not :mingw or ruby_version_is '2.5' } do - it "creates a timeval for a negative Fixnum" do - sec, usec = @s.rb_time_timeval(-1232141421) - sec.should be_kind_of(Integer) - sec.should == -1232141421 - usec.should be_kind_of(Integer) - usec.should == 0 - end + it "creates a timeval for a negative Fixnum" do + sec, usec = @s.rb_time_timeval(-1232141421) + sec.should be_kind_of(Integer) + sec.should == -1232141421 + usec.should be_kind_of(Integer) + usec.should == 0 + end - it "creates a timeval for a negative Float" do - sec, usec = @s.rb_time_timeval(-1.5) - sec.should be_kind_of(Integer) - sec.should == -2 - usec.should be_kind_of(Integer) - usec.should == 500000 - end + it "creates a timeval for a negative Float" do + sec, usec = @s.rb_time_timeval(-1.5) + sec.should be_kind_of(Integer) + sec.should == -2 + usec.should be_kind_of(Integer) + usec.should == 500000 + end - it "creates a timeval for a negative Rational" do - sec, usec = @s.rb_time_timeval(Rational(-3, 2)) - sec.should be_kind_of(Integer) - sec.should == -2 - usec.should be_kind_of(Integer) - usec.should == 500000 - end + it "creates a timeval for a negative Rational" do + sec, usec = @s.rb_time_timeval(Rational(-3, 2)) + sec.should be_kind_of(Integer) + sec.should == -2 + usec.should be_kind_of(Integer) + usec.should == 500000 end it "creates a timeval from a Time object" do @@ -224,30 +222,28 @@ describe "CApiTimeSpecs" do nsec.should == 500000000 end - guard -> { platform_is_not :mingw or ruby_version_is '2.5' } do - it "creates a timespec for a negative Fixnum" do - sec, nsec = @s.rb_time_timespec(-1232141421) - sec.should be_kind_of(Integer) - sec.should == -1232141421 - nsec.should be_kind_of(Integer) - nsec.should == 0 - end + it "creates a timespec for a negative Fixnum" do + sec, nsec = @s.rb_time_timespec(-1232141421) + sec.should be_kind_of(Integer) + sec.should == -1232141421 + nsec.should be_kind_of(Integer) + nsec.should == 0 + end - it "creates a timespec for a negative Float" do - sec, nsec = @s.rb_time_timespec(-1.5) - sec.should be_kind_of(Integer) - sec.should == -2 - nsec.should be_kind_of(Integer) - nsec.should == 500000000 - end + it "creates a timespec for a negative Float" do + sec, nsec = @s.rb_time_timespec(-1.5) + sec.should be_kind_of(Integer) + sec.should == -2 + nsec.should be_kind_of(Integer) + nsec.should == 500000000 + end - it "creates a timespec for a negative Rational" do - sec, nsec = @s.rb_time_timespec(Rational(-3, 2)) - sec.should be_kind_of(Integer) - sec.should == -2 - nsec.should be_kind_of(Integer) - nsec.should == 500000000 - end + it "creates a timespec for a negative Rational" do + sec, nsec = @s.rb_time_timespec(Rational(-3, 2)) + sec.should be_kind_of(Integer) + sec.should == -2 + nsec.should be_kind_of(Integer) + nsec.should == 500000000 end it "creates a timespec from a Time object" do |