summaryrefslogtreecommitdiff
path: root/test/psych/visitors/test_to_ruby.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/psych/visitors/test_to_ruby.rb')
-rw-r--r--test/psych/visitors/test_to_ruby.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb
index 8ad41dbe7d5..eb2841d9d0f 100644
--- a/test/psych/visitors/test_to_ruby.rb
+++ b/test/psych/visitors/test_to_ruby.rb
@@ -113,25 +113,25 @@ description:
def test_time
now = Time.now
formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
- ".%06d %+.2d:00" % [now.usec, now.gmt_offset / 3600]
+ ".%06d %+.2d:00" % [now.nsec, now.gmt_offset / 3600]
- assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
+ assert_equal now, Nodes::Scalar.new(formatted).to_ruby
end
def test_time_utc
now = Time.now.utc
formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
- ".%06dZ" % [now.usec]
+ ".%06dZ" % [now.nsec]
- assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
+ assert_equal now, Nodes::Scalar.new(formatted).to_ruby
end
def test_time_utc_no_z
now = Time.now.utc
formatted = now.strftime("%Y-%m-%d %H:%M:%S") +
- ".%06d" % [now.usec]
+ ".%06d" % [now.nsec]
- assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001
+ assert_equal now, Nodes::Scalar.new(formatted).to_ruby
end
def test_date