Sha256: 8a4f1b163ba189b3a4b0d4d9dc07dc1a92e3f2832c267b0511f2e726f4d04a51

Contents?: true

Size: 333 Bytes

Versions: 23

Compression:

Stored size: 333 Bytes

Contents

describe "Array#clear" do
  it "removes all elements" do
    a = [1, 2, 3, 4]
    a.clear
    a.should == []
  end

  it "returns self" do
    a = [1]
    old = a.object_id
    a.clear.object_id.should == old
  end

  it "leaves the Array empty" do
    a = [1]
    a.clear
    a.empty?.should == true
    a.size.should == 0
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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