summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/psych/visitors/test_to_ruby.rb6
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