diff options
Diffstat (limited to 'test/psych')
-rw-r--r-- | test/psych/test_psych.rb | 14 | ||||
-rw-r--r-- | test/psych/test_string.rb | 7 |
2 files changed, 7 insertions, 14 deletions
diff --git a/test/psych/test_psych.rb b/test/psych/test_psych.rb index ff5ffbafc6..82906f0af6 100644 --- a/test/psych/test_psych.rb +++ b/test/psych/test_psych.rb @@ -184,20 +184,20 @@ class TestPsych < Psych::TestCase end def test_symbolize_names - result = Psych.load(<<-eoyml) + yaml = <<-eoyml foo: bar: baz hoge: - fuga: piyo eoyml + + result = Psych.load(yaml) assert_equal result, { "foo" => { "bar" => "baz"}, "hoge" => [{ "fuga" => "piyo" }] } - result = Psych.load(<<-eoyml, symbolize_names: true) -foo: - bar: baz -hoge: - - fuga: piyo - eoyml + result = Psych.load(yaml, symbolize_names: true) + assert_equal result, { foo: { bar: "baz" }, hoge: [{ fuga: "piyo" }] } + + result = Psych.safe_load(yaml, symbolize_names: true) assert_equal result, { foo: { bar: "baz" }, hoge: [{ fuga: "piyo" }] } end end diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb index e80d19194b..973f38b9c2 100644 --- a/test/psych/test_string.rb +++ b/test/psych/test_string.rb @@ -37,13 +37,6 @@ module Psych assert_equal str, Psych.load(yaml) end - def test_doublequotes_when_there_are_single_quotes_only - str = "psych: Please don't escape ' with ' here." - yaml = Psych.dump str - assert_equal "--- \"psych: Please don't escape ' with ' here.\"\n", yaml - assert_equal str, Psych.load(yaml) - end - def test_plain_when_shorten_than_line_width_and_no_final_line_break str = "Lorem ipsum" yaml = Psych.dump str, line_width: 12 |