diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-12-27 17:35:32 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-12-27 17:35:32 +0100 |
commit | 727c97da1977544c91b9b3677811da3a44af7d53 (patch) | |
tree | 4f027117edad10789db57ff4b83242753a89e39d /spec/ruby/core/integer/shared | |
parent | 267bed0cd91711e2a8c79219e97431ba22137b01 (diff) | |
download | ruby-727c97da1977544c91b9b3677811da3a44af7d53.tar.gz |
Update to ruby/spec@4ce9f41
Diffstat (limited to 'spec/ruby/core/integer/shared')
-rw-r--r-- | spec/ruby/core/integer/shared/exponent.rb | 9 | ||||
-rw-r--r-- | spec/ruby/core/integer/shared/next.rb | 12 |
2 files changed, 13 insertions, 8 deletions
diff --git a/spec/ruby/core/integer/shared/exponent.rb b/spec/ruby/core/integer/shared/exponent.rb index f292cc2448..f949c514c8 100644 --- a/spec/ruby/core/integer/shared/exponent.rb +++ b/spec/ruby/core/integer/shared/exponent.rb @@ -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 diff --git a/spec/ruby/core/integer/shared/next.rb b/spec/ruby/core/integer/shared/next.rb index fd983d53ec..85b83d6965 100644 --- a/spec/ruby/core/integer/shared/next.rb +++ b/spec/ruby/core/integer/shared/next.rb @@ -1,25 +1,25 @@ describe :integer_next, shared: true do - it "returns the next larger positive Integer" do + it "returns the next larger positive Fixnum" do 2.send(@method).should == 3 end - it "returns the next larger negative Integer" do + it "returns the next larger negative Fixnum" do (-2).send(@method).should == -1 end - it "returns the next larger positive Integer" do + it "returns the next larger positive Bignum" do bignum_value.send(@method).should == bignum_value(1) end - it "returns the next larger negative Integer" do + it "returns the next larger negative Bignum" do (-bignum_value(1)).send(@method).should == -bignum_value end - it "overflows an Integer to an Integer" do + it "overflows a Fixnum to a Bignum" do fixnum_max.send(@method).should == fixnum_max + 1 end - it "underflows an Integer to an Integer" do + it "underflows a Bignum to a Fixnum" do (fixnum_min - 1).send(@method).should == fixnum_min end end |