From 803de61352145c2bd3c9237b2253fe931c286f24 Mon Sep 17 00:00:00 2001 From: Wolfgang Teuber Date: Fri, 21 Jul 2017 08:32:00 +0200 Subject: Double quote stings that contain single quotes only Fixes #324 --- test/psych/test_string.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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 -- cgit v1.2.3