summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-29 21:11:47 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-29 21:11:47 +0000
commit73645bb8e55dad0526419c7e434746d042fdacc1 (patch)
treea3dee35a9173bf0a81d8973e65312489e07be776 /test
parent53220c496c9b1df24c176e26adbdc28bd1e79e10 (diff)
downloadruby-73645bb8e55dad0526419c7e434746d042fdacc1.tar.gz
* ext/psych/lib/psych/visitors/to_ruby.rb: merge keys with a hash
should merge the hash in to the parent. * test/psych/test_merge_keys.rb: test for change. Fixes GH #202 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_merge_keys.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/psych/test_merge_keys.rb b/test/psych/test_merge_keys.rb
index 8b263e5186..1620a6a4e3 100644
--- a/test/psych/test_merge_keys.rb
+++ b/test/psych/test_merge_keys.rb
@@ -6,6 +6,16 @@ module Psych
attr_reader :bar
end
+ def test_merge_key_with_bare_hash
+ doc = Psych.load <<-eodoc
+map:
+ <<:
+ hello: world
+ eodoc
+ hash = { "map" => { "hello" => "world" } }
+ assert_equal hash, doc
+ end
+
def test_roundtrip_with_chevron_key
h = {}
v = { 'a' => h, '<<' => h }