From 34776105c8a6739ca3aad1de4a2c942f4a8f2f29 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 31 May 2020 18:22:49 +0200 Subject: Update to ruby/spec@4e486fa --- spec/ruby/core/array/fixtures/classes.rb | 2 +- spec/ruby/core/array/shared/slice.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'spec/ruby/core/array') 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 -- cgit v1.2.3