From: Benoit Daloze Date: 2011-01-20T20:44:28+09:00 Subject: [ruby-core:34656] Re: [Ruby 1.9-Bug#4297][Assigned] test_time in ruby/test/psych/test_json_tree.rb makes test failure On 20 January 2011 05:05, Motohiro KOSAKI wrote: > % svn diff > Index: test/psych/test_json_tree.rb > =================================================================== > --- test/psych/test_json_tree.rb � � � �(revision 30611) > +++ test/psych/test_json_tree.rb � � � �(working copy) > @@ -41,8 +41,8 @@ > � � end > > � � def test_time > - � � �time = Time.new(2010, 10, 10).utc > - � � �assert_equal "{\"a\": \"2010-10-10 07:00:00.000000000Z\"}\n", Psych.to_json({'a' => time }) > + � � �time = Time.utc(2010, 10, 10).utc > + � � �assert_equal "{\"a\": \"2010-10-10 00:00:00.000000000Z\"}\n", Psych.to_json({'a' => time }) > � � end > > � � def test_datetime I think the second 'utc' (Time#utc) is unnecessary as the Time is created with Time.utc. So the patch should be: % svn diff Index: test/psych/test_json_tree.rb =================================================================== --- test/psych/test_json_tree.rb (revision 30611) +++ test/psych/test_json_tree.rb (working copy) @@ -41,8 +41,8 @@ end def test_time - time = Time.new(2010, 10, 10).utc - assert_equal "{\"a\": \"2010-10-10 07:00:00.000000000Z\"}\n", Psych.to_json({'a' => time }) + time = Time.utc(2010, 10, 10) + assert_equal "{\"a\": \"2010-10-10 00:00:00.000000000Z\"}\n", Psych.to_json({'a' => time }) end def test_datetime