1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-12-27 17:35:32 +01:00
parent 267bed0cd9
commit 727c97da19
108 changed files with 1325 additions and 270 deletions

View file

@ -47,7 +47,9 @@ describe :integer_exponent, shared: true do
end
it "returns Float::INFINITY when the number is too big" do
2.send(@method, 427387904).should == Float::INFINITY
-> {
2.send(@method, 427387904).should == Float::INFINITY
}.should complain(/warning: in a\*\*b, b may be too big/)
end
it "raises a ZeroDivisionError for 0 ** -1" do
@ -105,7 +107,10 @@ describe :integer_exponent, shared: true do
end
it "switch to a Float when the values is too big" do
flt = @bignum.send(@method, @bignum)
flt = nil
-> {
flt = @bignum.send(@method, @bignum)
}.should complain(/warning: in a\*\*b, b may be too big/)
flt.should be_kind_of(Float)
flt.infinite?.should == 1
end