diff options
Diffstat (limited to 'spec/ruby/core/array/append_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/append_spec.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/ruby/core/array/append_spec.rb b/spec/ruby/core/array/append_spec.rb index 302dc4a901..5480d9f65e 100644 --- a/spec/ruby/core/array/append_spec.rb +++ b/spec/ruby/core/array/append_spec.rb @@ -1,6 +1,5 @@ require_relative '../../spec_helper' require_relative 'fixtures/classes' -require_relative 'shared/push' 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 #{frozen_error_class} on a frozen array" do - -> { ArraySpecs.frozen_array << 5 }.should raise_error(frozen_error_class) + 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 |
