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

@ -17,7 +17,7 @@ describe "Array#*" do
it "raises a TypeError if the argument can neither be converted to a string nor an integer" do
obj = mock('not a string or integer')
lambda{ [1,2] * obj }.should raise_error(TypeError)
->{ [1,2] * obj }.should raise_error(TypeError)
end
it "converts the passed argument to a String rather than an Integer" do
@ -28,15 +28,15 @@ describe "Array#*" do
end
it "raises a TypeError is the passed argument is nil" do
lambda{ [1,2] * nil }.should raise_error(TypeError)
->{ [1,2] * nil }.should raise_error(TypeError)
end
it "raises an ArgumentError when passed 2 or more arguments" do
lambda{ [1,2].send(:*, 1, 2) }.should raise_error(ArgumentError)
->{ [1,2].send(:*, 1, 2) }.should raise_error(ArgumentError)
end
it "raises an ArgumentError when passed no arguments" do
lambda{ [1,2].send(:*) }.should raise_error(ArgumentError)
->{ [1,2].send(:*) }.should raise_error(ArgumentError)
end
end
@ -65,8 +65,8 @@ describe "Array#* with an integer" do
end
it "raises an ArgumentError when passed a negative integer" do
lambda { [ 1, 2, 3 ] * -1 }.should raise_error(ArgumentError)
lambda { [] * -1 }.should raise_error(ArgumentError)
-> { [ 1, 2, 3 ] * -1 }.should raise_error(ArgumentError)
-> { [] * -1 }.should raise_error(ArgumentError)
end
describe "with a subclass of Array" do