diff options
author | Benoit Daloze <[email protected]> | 2024-02-12 10:56:33 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2024-02-12 10:56:33 +0100 |
commit | b19d2409be0b7bac65e6e54cfb3bedc61419ec01 (patch) | |
tree | 9046a7aea28aa043053acc473646b40828ec3736 /spec/ruby/shared | |
parent | 90a746d246d51d105d7f3e0d1c2ddf7994dd2d4b (diff) |
Update to ruby/spec@ce834ad
Diffstat (limited to 'spec/ruby/shared')
-rw-r--r-- | spec/ruby/shared/rational/coerce.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/ruby/shared/rational/coerce.rb b/spec/ruby/shared/rational/coerce.rb index 38925721ed..ccc8901ba0 100644 --- a/spec/ruby/shared/rational/coerce.rb +++ b/spec/ruby/shared/rational/coerce.rb @@ -1,5 +1,7 @@ require_relative '../../spec_helper' +require 'bigdecimal' + describe :rational_coerce, shared: true do it "returns the passed argument, self as Float, when given a Float" do result = Rational(3, 4).coerce(1.0) @@ -24,12 +26,9 @@ describe :rational_coerce, shared: true do Rational(3, 7).coerce(Rational(9, 2)).should == [Rational(9, 2), Rational(3, 7)] end - ruby_version_is ""..."3.4" do - require 'bigdecimal' - it "raises an error when passed a BigDecimal" do - -> { - Rational(500, 3).coerce(BigDecimal('166.666666666')) - }.should raise_error(TypeError, /BigDecimal can't be coerced into Rational/) - end + it "raises an error when passed a BigDecimal" do + -> { + Rational(500, 3).coerce(BigDecimal('166.666666666')) + }.should raise_error(TypeError, /BigDecimal can't be coerced into Rational/) end end |