aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/array/first_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/first_spec.rb')
-rw-r--r--spec/ruby/core/array/first_spec.rb10
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