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 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -266,10 +266,10 @@ describe :array_slice, shared: true do
a.send(@method, 1..0).should == []
a.send(@method, 1...0).should == []
lambda { a.send(@method, "a" .. "b") }.should raise_error(TypeError)
lambda { a.send(@method, "a" ... "b") }.should raise_error(TypeError)
lambda { a.send(@method, from .. "b") }.should raise_error(TypeError)
lambda { a.send(@method, from ... "b") }.should raise_error(TypeError)
-> { a.send(@method, "a" .. "b") }.should raise_error(TypeError)
-> { a.send(@method, "a" ... "b") }.should raise_error(TypeError)
-> { a.send(@method, from .. "b") }.should raise_error(TypeError)
-> { a.send(@method, from ... "b") }.should raise_error(TypeError)
end
it "returns the same elements as [m..n] and [m...n] with Range subclasses" do
@ -441,19 +441,19 @@ describe :array_slice, shared: true do
array = [1, 2, 3, 4, 5, 6]
obj = mock('large value')
obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
lambda { array.send(@method, obj) }.should raise_error(RangeError)
-> { array.send(@method, obj) }.should raise_error(RangeError)
obj = 8e19
lambda { array.send(@method, obj) }.should raise_error(RangeError)
-> { array.send(@method, obj) }.should raise_error(RangeError)
end
it "raises a RangeError when the length is out of range of Fixnum" do
array = [1, 2, 3, 4, 5, 6]
obj = mock('large value')
obj.should_receive(:to_int).and_return(0x8000_0000_0000_0000_0000)
lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
-> { array.send(@method, 1, obj) }.should raise_error(RangeError)
obj = 8e19
lambda { array.send(@method, 1, obj) }.should raise_error(RangeError)
-> { array.send(@method, 1, obj) }.should raise_error(RangeError)
end
end