Sha256: 9088b60d8f22f93504dab78dc1285826650a06102e46dc9199c311c1c2d8dfbc

Contents?: true

Size: 352 Bytes

Versions: 12

Compression:

Stored size: 352 Bytes

Contents

require 'facets/hash/slice'
require 'test/unit'

class TC_Hash_Slice < Test::Unit::TestCase

  def test_slice
    h = {:a=>1,:b=>2,:c=>3}
    e = {:b=>2, :a=>1}
    assert_equal(e, h.slice(:a, :b))
  end

  def test_slice!
    h = {:a=>1,:b=>2,:c=>3}
    e = {:c=>3}
    assert_equal(e, h.slice!(:a, :b))
    assert_equal({:a=>1,:b=>2}, h)
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
facets-2.8.4 test/core/hash/test_slice.rb
facets-2.8.3 test/core/hash/test_slice.rb
facets-2.8.2 test/core/hash/test_slice.rb
facets-2.8.1 test/core/hash/test_slice.rb
facets-2.8.0 test/core/hash/test_slice.rb
facets-2.7.0 test/core/hash/test_slice.rb
facets-2.6.0 test/core/hash/test_slice.rb
facets-2.4.4 test/core/hash/test_slice.rb
facets-2.5.1 test/core/hash/test_slice.rb
facets-2.5.0 test/core/hash/test_slice.rb
facets-2.4.5 test/core/hash/test_slice.rb
facets-2.5.2 test/core/hash/test_slice.rb