Sha256: 61b4cfbeba98fedcbf60b9708b3b8200a272658bca8ac969c3fe6be1927f6804

Contents?: true

Size: 562 Bytes

Versions: 16

Compression:

Stored size: 562 Bytes

Contents

require 'facets/hash/delete'
require 'test/unit'

class TC_Hash_Delete < Test::Unit::TestCase

  def test_delete_unless
    a = { :a => 1, :b => 2, :c => 3 }
    e = { :a => 1 }
    r = a.delete_unless{|k,v| v == 1}
    assert_equal( e, a )
  end

  def test_delete_values
    a = { :a => 1, :b => 2, :c => 3 }
    e = { :b => 2, :c => 3 }
    r = a.delete_values(1)
    assert_equal( e, a )
  end

  def test_delete_values_at
    a = { :a => 1, :b => 2, :c => 3 }
    e = { :b => 2, :c => 3 }
    r = a.delete_values_at(:a)
    assert_equal( e, a )
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/hash/test_delete.rb
facets-2.8.3 test/core/hash/test_delete.rb
facets-2.8.2 test/core/hash/test_delete.rb
facets-2.8.1 test/core/hash/test_delete.rb
facets-2.8.0 test/core/hash/test_delete.rb
facets-2.7.0 test/core/hash/test_delete.rb
facets-2.6.0 test/core/hash/test_delete.rb
facets-2.4.0 test/hash/test_delete.rb
facets-2.4.1 test/hash/test_delete.rb
facets-2.4.3 test/core/hash/test_delete.rb
facets-2.4.4 test/core/hash/test_delete.rb
facets-2.4.2 test/core/hash/test_delete.rb
facets-2.5.1 test/core/hash/test_delete.rb
facets-2.4.5 test/core/hash/test_delete.rb
facets-2.5.0 test/core/hash/test_delete.rb
facets-2.5.2 test/core/hash/test_delete.rb