diff options
Diffstat (limited to 'spec/ruby/core/array/append_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/append_spec.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/spec/ruby/core/array/append_spec.rb b/spec/ruby/core/array/append_spec.rb index 4c65004c58..5480d9f65e 100644 --- a/spec/ruby/core/array/append_spec.rb +++ b/spec/ruby/core/array/append_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#<<" do it "pushes the object onto the end of the array" do @@ -9,8 +9,8 @@ describe "Array#<<" do it "returns self to allow chaining" do a = [] b = a - (a << 1).should equal(b) - (a << 2 << 3).should equal(b) + (a << 1).should.equal?(b) + (a << 2 << 3).should.equal?(b) end it "correctly resizes the Array" do @@ -29,7 +29,13 @@ describe "Array#<<" do a.should == [:foo] end - it "raises a RuntimeError on a frozen array" do - lambda { ArraySpecs.frozen_array << 5 }.should raise_error(RuntimeError) + it "raises a FrozenError on a frozen array" do + -> { ArraySpecs.frozen_array << 5 }.should.raise(FrozenError) + end +end + +describe "Array#append" do + it "is an alias of Array#push" do + Array.instance_method(:append).should == Array.instance_method(:push) end end |
