aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/shared/rational/inspect.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/shared/rational/inspect.rb')
-rw-r--r--spec/ruby/shared/rational/inspect.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/ruby/shared/rational/inspect.rb b/spec/ruby/shared/rational/inspect.rb
index a7fd42ccac..19691a2f25 100644
--- a/spec/ruby/shared/rational/inspect.rb
+++ b/spec/ruby/shared/rational/inspect.rb
@@ -1,11 +1,13 @@
require_relative '../../spec_helper'
describe :rational_inspect, shared: true do
- conflicts_with :Prime do
- it "returns a string representation of self" do
- Rational(3, 4).inspect.should == "(3/4)"
- Rational(-5, 8).inspect.should == "(-5/8)"
- Rational(-1, -2).inspect.should == "(1/2)"
+ it "returns a string representation of self" do
+ Rational(3, 4).inspect.should == "(3/4)"
+ Rational(-5, 8).inspect.should == "(-5/8)"
+ Rational(-1, -2).inspect.should == "(1/2)"
+
+ # Guard against the Mathn library
+ guard -> { !defined?(Math.rsqrt) } do
Rational(bignum_value, 1).inspect.should == "(#{bignum_value}/1)"
end
end