diff options
Diffstat (limited to 'spec/ruby/core/array/append_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/append_spec.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/spec/ruby/core/array/append_spec.rb b/spec/ruby/core/array/append_spec.rb index 90e1688c5a..5480d9f65e 100644 --- a/spec/ruby/core/array/append_spec.rb +++ b/spec/ruby/core/array/append_spec.rb @@ -1,6 +1,5 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../fixtures/classes', __FILE__) -require File.expand_path('../shared/push', __FILE__) +require_relative '../../spec_helper' +require_relative 'fixtures/classes' describe "Array#<<" do it "pushes the object onto the end of the array" do @@ -10,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 @@ -30,13 +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 -ruby_version_is "2.5" do - describe "Array#append" do - it_behaves_like(:array_push, :append) +describe "Array#append" do + it "is an alias of Array#push" do + Array.instance_method(:append).should == Array.instance_method(:push) end end |
