Sha256: 552d4a8a9f9472f13c34b06aac7a2090731e706acd0cf4750c9ddd9f270373a0

Contents?: true

Size: 493 Bytes

Versions: 11

Compression:

Stored size: 493 Bytes

Contents

require 'facets/hash/op_and'
require 'test/unit'

class TC_Hash_Op < Test::Unit::TestCase

  def test_op_and_hash
    a = { :a => 1, :b => 2 }
    b = { :a => 1 }
    r = { :a => 1 }
    assert_equal( r, a & b )
  end

  def test_op_and_hash_subarray
    a = { :a => [1], :b => [2] }
    b = { :a => [1] }
    r = { :a => [1] }
    assert_equal( r, a & b )
  end

  def test_op_and_array
    a = { :a => 1, :b => 2 }
    b = [ :a ]
    r = { :a => 1 }
    assert_equal( r, a & b )
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

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