diff options
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 |
