Created
September 8, 2014 18:16
-
-
Save eternal-turtles/abeb9ef62283ed705c45 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ## Timecop | |
| ### A Library for Mocking Time, Date, and DateTime | |
| * https://github.com/travisjeffery/timecop | |
| * Mock: | |
| * Time.now | |
| * Date.today | |
| * DateTime.now | |
| * Individual arguments(year, month, day, hour, minute, second) | |
| * single-integer offset, interpreted as seconds from `Time.now` | |
| * Usage: | |
| * `Timecop.travel(some_datetimey_sort_of_object)` | |
| * 'seconds from' single-digit format (ex. `Timecop.travel(1_000_000)` travels forward in time one million seconds) | |
| * `Timecop.scale(scale, initial_time=optional)` (ex. 1 second/hour with `Timecop.scale(3600)`) | |
| * freeze time with `Timecop.freeze(some_datetimey_sort_of_object)` | |
| * setup / teardown without worry | |
| * toggle off Timecop with `Timecop.return` | |
| * `Timecop.safe_mode` - forces block syntax |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment