diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 01:52:26 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-01 01:52:26 +0000 |
commit | 44320c5b8d780a1572206735a88212faf9428f11 (patch) | |
tree | 33badfda3fb40eae5ce52c0e4882ae887f3df3cd /test/psych | |
parent | b4070513dde45474486955fbe1a3f3e5d787a342 (diff) | |
download | ruby-44320c5b8d780a1572206735a88212faf9428f11.tar.gz |
Merge psych-3.0.0.
See NEWS file for this update details.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 |