1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-09-25 10:41:16 +00:00
parent e59bf54b3a
commit e87fb88be8
142 changed files with 1165 additions and 1078 deletions

View file

@ -2,7 +2,8 @@ require_relative '../../spec_helper'
describe :rational_exponent, shared: true do
describe "when passed Rational" do
conflicts_with :Prime do
# Guard against the Mathn library
guard -> { !defined?(Math.rsqrt) } do
it "returns Rational(1) if the exponent is Rational(0)" do
(Rational(0) ** Rational(0)).should eql(Rational(1))
(Rational(1) ** Rational(0)).should eql(Rational(1))
@ -45,7 +46,8 @@ describe :rational_exponent, shared: true do
(Rational(3, -bignum_value) ** -4).should == Rational(7237005577332262213973186563042994240829374041602535252466099000494570602496, 81)
end
conflicts_with :Prime do
# Guard against the Mathn library
guard -> { !defined?(Math.rsqrt) } do
it "returns Rational(1, 1) when the passed argument is 0" do
(Rational(3, 4) ** 0).should eql(Rational(1, 1))
(Rational(-3, 4) ** 0).should eql(Rational(1, 1))