summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-10 20:02:33 +0900
committerGitHub <noreply@github.com>2021-05-10 20:02:33 +0900
commit8fcdc380c0493911e95bea6989c2a629ba68e101 (patch)
treed78cd2bf931f3abd4f763dabcec22cf77de1820f /test
parente417d0eb5d7c8308802519a4dc87f42912c63884 (diff)
parent1c5c29e81fd5572df2ec6cdef655b1521fd4c97e (diff)
downloadpsych-8fcdc380c0493911e95bea6989c2a629ba68e101.tar.gz
Merge pull request #480 from Shopify/symbolize-name-non-string-keys
Fix symbolize_name with non-string keys
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_psych.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb
index 76a3627..9eea4a0 100644
--- a/test/psych/test_psych.rb
+++ b/test/psych/test_psych.rb
@@ -371,17 +371,18 @@ class TestPsych < Psych::TestCase
yaml = <<-eoyml
foo:
bar: baz
+ 1: 2
hoge:
- fuga: piyo
eoyml
result = Psych.load(yaml)
- assert_equal result, { "foo" => { "bar" => "baz"}, "hoge" => [{ "fuga" => "piyo" }] }
+ assert_equal result, { "foo" => { "bar" => "baz", 1 => 2 }, "hoge" => [{ "fuga" => "piyo" }] }
result = Psych.load(yaml, symbolize_names: true)
- assert_equal result, { foo: { bar: "baz" }, hoge: [{ fuga: "piyo" }] }
+ assert_equal result, { foo: { bar: "baz", 1 => 2 }, hoge: [{ fuga: "piyo" }] }
result = Psych.safe_load(yaml, symbolize_names: true)
- assert_equal result, { foo: { bar: "baz" }, hoge: [{ fuga: "piyo" }] }
+ assert_equal result, { foo: { bar: "baz", 1 => 2 }, hoge: [{ fuga: "piyo" }] }
end
end