summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array
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/array
parentf4502b001a665109bf776f9037ecbc52cb5f2d88 (diff)
Update to ruby/spec@4e486fa
Diffstat (limited to 'spec/ruby/core/array')
-rw-r--r--spec/ruby/core/array/fixtures/classes.rb2
-rw-r--r--spec/ruby/core/array/shared/slice.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/ruby/core/array/fixtures/classes.rb b/spec/ruby/core/array/fixtures/classes.rb
index 42071ed0cd..2791a2eb5d 100644
--- a/spec/ruby/core/array/fixtures/classes.rb
+++ b/spec/ruby/core/array/fixtures/classes.rb
@@ -144,7 +144,7 @@ module ArraySpecs
end
def self.universal_pack_object
- obj = mock("string float int")
+ obj = mock("string float int".freeze)
obj.stub!(:to_int).and_return(1)
obj.stub!(:to_str).and_return("1")
obj.stub!(:to_f).and_return(1.0)
diff --git a/spec/ruby/core/array/shared/slice.rb b/spec/ruby/core/array/shared/slice.rb
index d6b4547b2b..f36890fa4e 100644
--- a/spec/ruby/core/array/shared/slice.rb
+++ b/spec/ruby/core/array/shared/slice.rb
@@ -466,6 +466,12 @@ describe :array_slice, shared: true do
obj = 8e19
-> { array.send(@method, obj) }.should raise_error(RangeError)
+
+ # boundary value when longs are 64 bits
+ -> { array.send(@method, 2.0**63) }.should raise_error(RangeError)
+
+ # just under the boundary value when longs are 64 bits
+ array.send(@method, max_long.to_f.prev_float).should == nil
end
it "raises a RangeError when the length is out of range of Fixnum" do