diff options
Diffstat (limited to 'test/psych')
-rw-r--r-- | test/psych/visitors/test_to_ruby.rb | 6 | ||||
-rw-r--r-- | test/psych/visitors/test_yaml_tree.rb | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb index dc02fbc29d..87712f71ba 100644 --- a/test/psych/visitors/test_to_ruby.rb +++ b/test/psych/visitors/test_to_ruby.rb @@ -115,7 +115,7 @@ description: formatted = now.strftime("%Y-%m-%d %H:%M:%S") + ".%06d %+.2d:00" % [now.usec, now.gmt_offset / 3600] - assert_equal now, Nodes::Scalar.new(formatted).to_ruby + assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001 end def test_time_utc @@ -123,7 +123,7 @@ description: formatted = now.strftime("%Y-%m-%d %H:%M:%S") + ".%06dZ" % [now.usec] - assert_equal now, Nodes::Scalar.new(formatted).to_ruby + assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001 end def test_time_utc_no_z @@ -131,7 +131,7 @@ description: formatted = now.strftime("%Y-%m-%d %H:%M:%S") + ".%06d" % [now.usec] - assert_equal now, Nodes::Scalar.new(formatted).to_ruby + assert_in_delta now, Nodes::Scalar.new(formatted).to_ruby, 0.000001 end def test_date diff --git a/test/psych/visitors/test_yaml_tree.rb b/test/psych/visitors/test_yaml_tree.rb index a0a2336e75..7dab85dc5b 100644 --- a/test/psych/visitors/test_yaml_tree.rb +++ b/test/psych/visitors/test_yaml_tree.rb @@ -45,7 +45,8 @@ module Psych end def test_time - assert_cycle Time.now + t = Time.now + assert_in_delta t, Psych.load(Psych.dump(t)), 0.000001 end def test_date |