From 3b87ff32de3d97780e7b077aabebc5b56a8283ab Mon Sep 17 00:00:00 2001 From: tenderlove Date: Tue, 6 Jul 2010 16:06:20 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb (parse_time): dealing with negative partial hour time zones. [ruby-core:31064] * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto * test/psych/visitors/test_to_ruby.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/visitors/test_to_ruby.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/psych/visitors') diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb index 077b8796a5..b5b8e1443d 100644 --- a/test/psych/visitors/test_to_ruby.rb +++ b/test/psych/visitors/test_to_ruby.rb @@ -112,10 +112,10 @@ description: def test_time now = Time.now - formatted = now.strftime("%Y-%m-%d %H:%M:%S") + - ".%09d %+.2d:%2d" % [ now.nsec, - now.gmt_offset / 3600, - now.gmt_offset % 3600 / 60] + zone = now.strftime('%z') + zone = " #{zone[0,3]}:#{zone[3,5]}" + + formatted = now.strftime("%Y-%m-%d %H:%M:%S.%9N") + zone assert_equal now, Nodes::Scalar.new(formatted).to_ruby end -- cgit v1.2.3