Sha256: f0fe8b6755593d0efc0de3ee00b25ab76101f5f85a44b5a27a2f15ae77287156

Contents?: true

Size: 470 Bytes

Versions: 23

Compression:

Stored size: 470 Bytes

Contents

describe "Array#delete_if" do
  before do
    @a = [ "a", "b", "c" ]
  end

  it "removes each element for which block returns true" do
    @a = [ "a", "b", "c" ]
    @a.delete_if { |x| x >= "b" }
    @a.should == ["a"]
  end

  it "returns self" do
    @a.delete_if { true }.equal?(@a).should be_true
  end

  it "returns self when called on an Array emptied with #shift" do
    array = [1]
    array.shift
    array.delete_if { |x| true }.should equal(array)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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