diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-27 03:11:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-27 03:11:18 +0000 |
commit | b613a2c5ae03c425bc94771e4eced1b80e4e80d0 (patch) | |
tree | a2bd8c92dbafcc5897e4105682517df190e35f3f /test/psych/test_psych.rb | |
parent | 33201294eb59f10ccb98752207c2cc9d1c8757cc (diff) |
Merge psych-3.0.0.beta4 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r-- | test/psych/test_psych.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index d0de95627e..ff5ffbafc6 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -182,4 +182,22 @@ class TestPsych < Psych::TestCase ["tag:example.com,2002:foo", "bar"] ], types end + + def test_symbolize_names + result = Psych.load(<<-eoyml) +foo: + bar: baz +hoge: + - fuga: piyo + eoyml + assert_equal result, { "foo" => { "bar" => "baz"}, "hoge" => [{ "fuga" => "piyo" }] } + + result = Psych.load(<<-eoyml, symbolize_names: true) +foo: + bar: baz +hoge: + - fuga: piyo + eoyml + assert_equal result, { foo: { bar: "baz" }, hoge: [{ fuga: "piyo" }] } + end end |