diff options
Diffstat (limited to 'spec/ruby/shared/rational/round.rb')
-rw-r--r-- | spec/ruby/shared/rational/round.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/ruby/shared/rational/round.rb b/spec/ruby/shared/rational/round.rb index a3f92413e7..36ed476350 100644 --- a/spec/ruby/shared/rational/round.rb +++ b/spec/ruby/shared/rational/round.rb @@ -47,8 +47,11 @@ describe :rational_round, shared: true do it "returns a Rational" do @rational.round(1).should be_kind_of(Rational) @rational.round(2).should be_kind_of(Rational) - Rational(0, 1).round(1).should be_kind_of(Rational) - Rational(2, 1).round(1).should be_kind_of(Rational) + # Guard against the Mathn library + guard -> { !defined?(Math.rsqrt) } do + Rational(0, 1).round(1).should be_kind_of(Rational) + Rational(2, 1).round(1).should be_kind_of(Rational) + end end it "moves the truncation point n decimal places right" do |