summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_merge_keys.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/psych/test_merge_keys.rb b/test/psych/test_merge_keys.rb
new file mode 100644
index 0000000000..9aadcc85e5
--- /dev/null
+++ b/test/psych/test_merge_keys.rb
@@ -0,0 +1,21 @@
+require_relative 'helper'
+
+module Psych
+ class TestMergeKeys < TestCase
+ # [ruby-core:34679]
+ def test_merge_key
+ yaml = <<-eoyml
+foo: &foo
+ hello: world
+bar:
+ << : *foo
+ baz: boo
+ eoyml
+
+ hash = {
+ "foo" => { "hello" => "world"},
+ "bar" => { "hello" => "world", "baz" => "boo" } }
+ assert_equal hash, Psych.load(yaml)
+ end
+ end
+end