mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/psych/visitors/test_to_ruby.rb: switching to assert_in_delta
* test/psych/visitors/test_yaml_tree.rb: switching to assert_in_delta git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6c4a07dfa7
commit
0a5d4d29e2
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue