Created
January 24, 2019 09:41
-
-
Save pooza/a571c7903c9695fc46d8f36178c9fed2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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