diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-07 11:07:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-07 11:07:56 -0700 |
commit | a5a87e37c7ee522b36b1d43dc78a0f7a50d41efc (patch) | |
tree | f529fcb65a29daf896a7feda0b7c4aa28512a35b /test | |
parent | 2c2b6e72b18fc6666b218837016b0be9d29c48ce (diff) | |
download | psych-a5a87e37c7ee522b36b1d43dc78a0f7a50d41efc.zip |
merging from ruby
Diffstat (limited to 'test')
-rw-r--r-- | test/psych/visitors/test_to_ruby.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb index 1a4d319..b5b8e14 100644 --- a/test/psych/visitors/test_to_ruby.rb +++ b/test/psych/visitors/test_to_ruby.rb @@ -112,8 +112,10 @@ description: def test_time now = Time.now - formatted = now.strftime("%Y-%m-%d %H:%M:%S") + - ".%09d %+.2d:00" % [now.nsec, now.gmt_offset / 3600] + 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 |