Sha256: e5dcf030eeaa5e47a86714013c251e3f439cde823ce6c9ef1142bd6b3b3c69ee

Contents?: true

Size: 405 Bytes

Versions: 23

Compression:

Stored size: 405 Bytes

Contents

describe "Array#push" do
  it "appends the arguments to the array" do
    a = [ "a", "b", "c" ]
    a.push("d", "e", "f").should equal(a)
    a.push().should == ["a", "b", "c", "d", "e", "f"]
    a.push(5)
    a.should == ["a", "b", "c", "d", "e", "f", 5]
  end

  it "isn't confused by previous shift" do
    a = [ "a", "b", "c" ]
    a.shift
    a.push("foo")
    a.should == ["b", "c", "foo"]
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
opal-0.3.41 spec/core/array/push_spec.rb
opal-0.3.40 spec/core/array/push_spec.rb
opal-0.3.39 spec/core/array/push_spec.rb
opal-0.3.38 spec/core/array/push_spec.rb
opal-0.3.37 spec/core/array/push_spec.rb
opal-0.3.36 spec/core/array/push_spec.rb
opal-0.3.35 spec/core/array/push_spec.rb
opal-0.3.34 spec/core/array/push_spec.rb
opal-0.3.33 spec/core/array/push_spec.rb
opal-0.3.32 spec/core/array/push_spec.rb
opal-0.3.31 spec/core/array/push_spec.rb
opal-0.3.30 spec/core/array/push_spec.rb
opal-0.3.29 spec/core/array/push_spec.rb
opal-0.3.28 spec/core/array/push_spec.rb
opal-0.3.27 spec/core/array/push_spec.rb
opal-0.3.26 spec/core/array/push_spec.rb
opal-0.3.25 spec/core/array/push_spec.rb
opal-0.3.22 spec/core/array/push_spec.rb
opal-0.3.21 test/core/array/push_spec.rb
opal-0.3.20 test/core/array/push_spec.rb