aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/integer
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-05-31 18:22:49 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-05-31 18:22:49 +0200
commit34776105c8a6739ca3aad1de4a2c942f4a8f2f29 (patch)
tree0103cf2cc89c1322d8c3e88fff0a80b54db8320b /spec/ruby/core/integer
parentf4502b001a665109bf776f9037ecbc52cb5f2d88 (diff)
downloadruby-34776105c8a6739ca3aad1de4a2c942f4a8f2f29.tar.gz
Update to ruby/spec@4e486fa
Diffstat (limited to 'spec/ruby/core/integer')
-rw-r--r--spec/ruby/core/integer/left_shift_spec.rb5
-rw-r--r--spec/ruby/core/integer/right_shift_spec.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/spec/ruby/core/integer/left_shift_spec.rb b/spec/ruby/core/integer/left_shift_spec.rb
index 4b5ef9386e..f9a8c9bbd1 100644
--- a/spec/ruby/core/integer/left_shift_spec.rb
+++ b/spec/ruby/core/integer/left_shift_spec.rb
@@ -71,8 +71,11 @@ describe "Integer#<< (with n << m)" do
it "calls #to_int to convert the argument to an Integer" do
obj = mock("4")
obj.should_receive(:to_int).and_return(4)
-
(3 << obj).should == 48
+
+ obj = mock("to_int_neg_bignum")
+ obj.should_receive(:to_int).and_return(-bignum_value)
+ (3 << obj).should == 0
end
it "raises a TypeError when #to_int does not return an Integer" do
diff --git a/spec/ruby/core/integer/right_shift_spec.rb b/spec/ruby/core/integer/right_shift_spec.rb
index 3eeaf3eb2f..1eac6cb5bc 100644
--- a/spec/ruby/core/integer/right_shift_spec.rb
+++ b/spec/ruby/core/integer/right_shift_spec.rb
@@ -71,8 +71,11 @@ describe "Integer#>> (with n >> m)" do
it "calls #to_int to convert the argument to an Integer" do
obj = mock("2")
obj.should_receive(:to_int).and_return(2)
-
(8 >> obj).should == 2
+
+ obj = mock("to_int_bignum")
+ obj.should_receive(:to_int).and_return(bignum_value)
+ (8 >> obj).should == 0
end
it "raises a TypeError when #to_int does not return an Integer" do