From e115627a1846d2c15d1319e6399fa5f8d6e5cb61 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Mon, 7 Nov 2011 11:33:39 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look like base 60 numbers are serialized as quoted strings. * test/psych/test_string.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_string.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/psych/test_string.rb') diff --git a/test/psych/test_string.rb b/test/psych/test_string.rb index 51f1280abf..cffc12163b 100644 --- a/test/psych/test_string.rb +++ b/test/psych/test_string.rb @@ -2,6 +2,12 @@ require 'psych/helper' module Psych class TestString < TestCase + def test_string_with_base_60 + yaml = Psych.dump '01:03:05' + assert_match "'01:03:05'", yaml + assert_equal '01:03:05', Psych.load(yaml) + end + def test_tagged_binary_should_be_dumped_as_binary string = "hello world!" string.force_encoding 'ascii-8bit' -- cgit v1.2.3