/vendor/gems/facets-2.4.5/test/core/hash/test_weave.rb
Ruby | 18 lines | 10 code | 7 blank | 1 comment | 0 complexity | fd38b1ab7a2b2698ce2f29ee09f45c1a MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- # Test for facets/hash/weave
- require 'facets/hash/weave.rb'
- require 'test/unit'
- class TestHashWeave < Test::Unit::TestCase
- def test_weave
- b = { :a=>1, :b=>[1,2,3], :c=>{ :x=>'X' } }
- c = { :a=>2, :b=>[4,5,6], :c=>{ :x=>'A', :y => 'B' } }
- r = { :a=>2, :b=>[1,2,3,4,5,6], :c=>{ :x => 'A', :y => 'B' } }
- assert_equal( r, b.weave(c) )
- end
- end