PageRenderTime 51ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/vendor/gems/facets-2.4.5/test/core/hash/test_weave.rb

https://bitbucket.org/mediashelf/fedora-migrator
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
  1. # Test for facets/hash/weave
  2. require 'facets/hash/weave.rb'
  3. require 'test/unit'
  4. class TestHashWeave < Test::Unit::TestCase
  5. def test_weave
  6. b = { :a=>1, :b=>[1,2,3], :c=>{ :x=>'X' } }
  7. c = { :a=>2, :b=>[4,5,6], :c=>{ :x=>'A', :y => 'B' } }
  8. r = { :a=>2, :b=>[1,2,3,4,5,6], :c=>{ :x => 'A', :y => 'B' } }
  9. assert_equal( r, b.weave(c) )
  10. end
  11. end