summaryrefslogtreecommitdiff
path: root/test/psych/test_merge_keys.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 02:34:50 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-22 02:34:50 +0000
commit5b1c06c74b65e12c8e552bacf6faed5c0b2826cd (patch)
tree4c378096ded924eea76b20eaf02ac81c430932f6 /test/psych/test_merge_keys.rb
parent7b876e65ed79d9ca4a22f7731a463ee30e35b30b (diff)
* ext/psych/lib/psych/visitors/to_ruby.rb: merge keys are actually
part of YAML 1.1, so they should be supported. Remove warning and merge keys to parent. [ruby-core:34679] * test/psych/test_merge_keys.rb: test for merge keys git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_merge_keys.rb')
-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