Skip to content

Commit

Permalink
Fix test (#96)
Browse files Browse the repository at this point in the history
From http://apidock.com/ruby/Time/nsec:

The lowest digit of to_f and nsec is different because IEEE 754 double is not
accurate enough to represent nanoseconds from the Epoch. The accurate value is
returned by nsec.
  • Loading branch information
Travis Jeffery committed Aug 4, 2013
1 parent 9ca79b4 commit 48daaab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/timecop_with_active_support_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def test_travel_does_not_reduce_precision_of_time
Timecop.travel(1)
long_ago = Time.now
sleep(0.000001)
assert_not_equal long_ago.to_f, Time.now.to_f
assert_not_equal long_ago.nsec, Time.now.nsec
end
end

0 comments on commit 48daaab

Please sign in to comment.