/vendor/gems/facets-2.4.5/test/core/hash/test_op_and.rb
https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 28 lines · 22 code · 6 blank · 0 comment · 0 complexity · 1c52dea6694b978066921d5247a40f78 MD5 · raw file
- 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