Skip to content

Instantly share code, notes, and snippets.

@pooza
Created January 24, 2019 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/a571c7903c9695fc46d8f36178c9fed2 to your computer and use it in GitHub Desktop.
Save pooza/a571c7903c9695fc46d8f36178c9fed2 to your computer and use it in GitHub Desktop.
module MulukhiyaTootProxy
class ConfigTest < Test::Unit::TestCase
def test_deep_merge
config = Config.deep_merge({}, {a: 111, b: 222})
assert_equal(config, {'a' => 111, 'b' => 222})
config = Config.deep_merge(config, {c: {d: 333, e: 444}})
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 444}})
config = Config.deep_merge(config, {c: {e: 333, f: 444}})
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'d' => 333, 'e' => 333, 'f' => 444}})
config = Config.deep_merge(config, {c: {d: nil}})
assert_equal(config, {'a' => 111, 'b' => 222, 'c' => {'e' => 333, 'f' => 444}})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment