summaryrefslogtreecommitdiff
path: root/test/psych/test_psych.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_psych.rb')
-rw-r--r--test/psych/test_psych.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index d0de956..ff5ffba 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