diff options
Diffstat (limited to 'spec/ruby/core/array/first_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/first_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/array/first_spec.rb b/spec/ruby/core/array/first_spec.rb index 60a0a76594..66eeba6565 100644 --- a/spec/ruby/core/array/first_spec.rb +++ b/spec/ruby/core/array/first_spec.rb @@ -1,5 +1,5 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' describe "Array#first" do it "returns the first element" do @@ -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 |
