summaryrefslogtreecommitdiff
path: root/test/psych/test_string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/test_string.rb')
-rw-r--r--test/psych/test_string.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb
index 1ce16fdf3e..26a4e201e5 100644
--- a/test/psych/test_string.rb
+++ b/test/psych/test_string.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require_relative 'helper'
module Psych
@@ -23,6 +24,11 @@ module Psych
assert_equal 2, Psych.dump(%Q{<%= ENV["PATH"] %>}).count('"')
end
+ def test_no_quotes_when_start_with_non_ascii_character
+ yaml = Psych.dump 'Český non-ASCII'.encode(Encoding::UTF_8)
+ assert_match(/---\s*[^"'!]+$/, yaml)
+ end
+
def test_doublequotes_when_there_is_a_single
yaml = Psych.dump "@123'abc"
assert_match(/---\s*"/, yaml)