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/first_spec.rb | |
| parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/array/first_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/first_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/array/first_spec.rb b/spec/ruby/core/array/first_spec.rb index 5a0a25aeef..66eeba6565 100644 --- a/spec/ruby/core/array/first_spec.rb +++ b/spec/ruby/core/array/first_spec.rb @@ -30,11 +30,11 @@ describe "Array#first" do end it "raises an ArgumentError when count is negative" do - lambda { [1, 2].first(-1) }.should raise_error(ArgumentError) + -> { [1, 2].first(-1) }.should raise_error(ArgumentError) end it "raises a RangeError when count is a Bignum" do - lambda { [].first(bignum_value) }.should raise_error(RangeError) + -> { [].first(bignum_value) }.should raise_error(RangeError) end it "returns the entire array when count > length" do @@ -66,11 +66,11 @@ describe "Array#first" do end it "raises a TypeError if the passed argument is not numeric" do - lambda { [1,2].first(nil) }.should raise_error(TypeError) - lambda { [1,2].first("a") }.should raise_error(TypeError) + -> { [1,2].first(nil) }.should raise_error(TypeError) + -> { [1,2].first("a") }.should raise_error(TypeError) obj = mock("nonnumeric") - lambda { [1,2].first(obj) }.should raise_error(TypeError) + -> { [1,2].first(obj) }.should raise_error(TypeError) end it "does not return subclass instance when passed count on Array subclasses" do |
