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/core/integer/shared | |
parent | 3a2073e61b6ccce6d07d31ebd89d4c385b9a55f2 (diff) | |
download | ruby-826f44834fe11f3f9c52343443a15b6c83466889.tar.gz |
Drop support for ruby 2.4 from ruby/spec
Diffstat (limited to 'spec/ruby/core/integer/shared')
-rw-r--r-- | spec/ruby/core/integer/shared/arithmetic_coerce.rb | 20 | ||||
-rw-r--r-- | spec/ruby/core/integer/shared/integer_rounding.rb | 16 |
2 files changed, 3 insertions, 33 deletions
diff --git a/spec/ruby/core/integer/shared/arithmetic_coerce.rb b/spec/ruby/core/integer/shared/arithmetic_coerce.rb index 4c0cbcb999..1260192df1 100644 --- a/spec/ruby/core/integer/shared/arithmetic_coerce.rb +++ b/spec/ruby/core/integer/shared/arithmetic_coerce.rb @@ -1,25 +1,5 @@ require_relative '../fixtures/classes' -describe :integer_arithmetic_coerce_rescue, shared: true do - it "rescues exception (StandardError and subclasses) raised in other#coerce and raises TypeError" do - b = mock("numeric with failed #coerce") - b.should_receive(:coerce).and_raise(IntegerSpecs::CoerceError) - - # e.g. 1 + b - -> { 1.send(@method, b) }.should raise_error(TypeError, /MockObject can't be coerced into Integer/) - end - - it "does not rescue Exception and StandardError siblings raised in other#coerce" do - [Exception, NoMemoryError].each do |exception| - b = mock("numeric with failed #coerce") - b.should_receive(:coerce).and_raise(exception) - - # e.g. 1 + b - -> { 1.send(@method, b) }.should raise_error(exception) - end - end -end - describe :integer_arithmetic_coerce_not_rescue, shared: true do it "does not rescue exception raised in other#coerce" do b = mock("numeric with failed #coerce") diff --git a/spec/ruby/core/integer/shared/integer_rounding.rb b/spec/ruby/core/integer/shared/integer_rounding.rb index 3fb6e830ef..56d1819f84 100644 --- a/spec/ruby/core/integer/shared/integer_rounding.rb +++ b/spec/ruby/core/integer/shared/integer_rounding.rb @@ -11,19 +11,9 @@ describe :integer_rounding_positive_precision, shared: true do end end - ruby_version_is "2.4"..."2.5" do - it "returns itself as a float if passed a positive precision" do - [2, -4, 10**70, -10**100].each do |v| - v.send(@method, 42).should eql(v.to_f) - end - end - end - - ruby_version_is "2.5" do - it "returns itself if passed a positive precision" do - [2, -4, 10**70, -10**100].each do |v| - v.send(@method, 42).should eql(v) - end + it "returns itself if passed a positive precision" do + [2, -4, 10**70, -10**100].each do |v| + v.send(@method, 42).should eql(v) end end end |