diff options
Diffstat (limited to 'test/psych')
-rw-r--r-- | test/psych/test_encoding.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/psych/test_encoding.rb b/test/psych/test_encoding.rb index 517cae2069..544337d4c0 100644 --- a/test/psych/test_encoding.rb +++ b/test/psych/test_encoding.rb @@ -249,6 +249,15 @@ module Psych assert_encodings @utf8, @handler.strings end + def test_dump_non_ascii_string_to_file + Tempfile.create(['utf8', 'yml'], :encoding => 'UTF-8') do |t| + h = {'one' => 'いち'} + Psych.dump(h, t) + t.close + assert_equal h, Psych.load_file(t.path) + end + end + private def assert_encodings encoding, strings strings.each do |str| |