From 5b1c06c74b65e12c8e552bacf6faed5c0b2826cd Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 22 Jan 2011 02:34:50 +0000 Subject: * 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 --- test/psych/test_merge_keys.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/psych/test_merge_keys.rb (limited to 'test/psych/test_merge_keys.rb') 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 -- cgit v1.2.3