summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-09-11 12:18:43 +0900
committerGitHub <noreply@github.com>2017-09-11 12:18:43 +0900
commit3186e870f8411e5ba7515a2b751e2ff499eec472 (patch)
tree48869d8e2cbf2969a60edac3f41a9270156c4910 /test
parentbbdd6637e37d4b821a8c7075e9ccd17ea0e07569 (diff)
parent803de61352145c2bd3c9237b2253fe931c286f24 (diff)
downloadpsych-3186e870f8411e5ba7515a2b751e2ff499eec472.zip
Merge pull request #325 from knugie/fix_324
Double quote stings that contain single quotes only
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_string.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb
index 973f38b..e80d191 100644
--- a/test/psych/test_string.rb
+++ b/test/psych/test_string.rb
@@ -37,6 +37,13 @@ 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