Sha256: 8a3bfc1cfd4daf65aa6beb554ba519695536a91f8742a70c40d4ccda566030cf

Contents?: true

Size: 529 Bytes

Versions: 10

Compression:

Stored size: 529 Bytes

Contents

require 'with_deep_merge'

class WithDeepMergeTest < Test::Unit::TestCase
  include WithDeepMerge

  def test_simple_merge
    base_hash = { "a" => "b" }
    other_hash = { "c" => "d" }
    assert_equal({ "a" => "b", "c" => "d" }, deep_merge(base_hash, other_hash))
  end

  def test_recursive_merge
    base_hash = { "a" =>  { "b" => "c", "d" => "e" } }
    other_hash = { "a" => { "b" => "z", "f" => "g" } }
    assert_equal({ "a" => { "b" => "z", "d" => "e", "f" => "g" } },
      deep_merge(base_hash, other_hash))
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
govspeak-3.5.1 test/with_deep_merge_test.rb
govspeak-3.5.0 test/with_deep_merge_test.rb
govspeak-3.4.0 test/with_deep_merge_test.rb
govspeak-3.3.0 test/with_deep_merge_test.rb
govspeak-3.2.0 test/with_deep_merge_test.rb
govspeak-3.1.1 test/with_deep_merge_test.rb
govspeak-3.1.0 test/with_deep_merge_test.rb
govspeak-3.0.0 test/with_deep_merge_test.rb
govspeak-2.0.2 test/with_deep_merge_test.rb
govspeak-2.0.0 test/with_deep_merge_test.rb