Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rounding errors with #travel_to by resetting the usec on any pass…
…ed time to zero, so we only travel with per-second precision, not anything deeper than that.
- Loading branch information
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9f6e82e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you reconsider this? Many of us have used Timecop for years without this rounding behavior, and it seems strange to account for a limitation of MySQL by compromising part of Rails that isn't really related to the database (preventing us from employing
#travel_to
fruitfully on sub-second timescales).9f6e82e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, this makes
travel_to
pretty much useless for assertions on Postgres timestamps.9f6e82e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this very annoying as well. It took me a while to find out why this code would fail in a test.