diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/array/shift_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/array/shift_spec.rb')
-rw-r--r-- | spec/ruby/core/array/shift_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/array/shift_spec.rb b/spec/ruby/core/array/shift_spec.rb index 26bce8aeb3..ef3c9fe1cd 100644 --- a/spec/ruby/core/array/shift_spec.rb +++ b/spec/ruby/core/array/shift_spec.rb @@ -31,10 +31,10 @@ describe "Array#shift" do end it "raises a #{frozen_error_class} on a frozen array" do - lambda { ArraySpecs.frozen_array.shift }.should raise_error(frozen_error_class) + -> { ArraySpecs.frozen_array.shift }.should raise_error(frozen_error_class) end it "raises a #{frozen_error_class} on an empty frozen array" do - lambda { ArraySpecs.empty_frozen_array.shift }.should raise_error(frozen_error_class) + -> { ArraySpecs.empty_frozen_array.shift }.should raise_error(frozen_error_class) end describe "passed a number n as an argument" do @@ -90,7 +90,7 @@ describe "Array#shift" do end it "raises an ArgumentError if n is negative" do - lambda{ [1, 2, 3].shift(-1) }.should raise_error(ArgumentError) + ->{ [1, 2, 3].shift(-1) }.should raise_error(ArgumentError) end it "tries to convert n to an Integer using #to_int" do @@ -105,12 +105,12 @@ describe "Array#shift" do end it "raises a TypeError when the passed n cannot be coerced to Integer" do - lambda{ [1, 2].shift("cat") }.should raise_error(TypeError) - lambda{ [1, 2].shift(nil) }.should raise_error(TypeError) + ->{ [1, 2].shift("cat") }.should raise_error(TypeError) + ->{ [1, 2].shift(nil) }.should raise_error(TypeError) end it "raises an ArgumentError if more arguments are passed" do - lambda{ [1, 2].shift(1, 2) }.should raise_error(ArgumentError) + ->{ [1, 2].shift(1, 2) }.should raise_error(ArgumentError) end it "does not return subclass instances with Array subclass" do |