Created
July 3, 2012 10:51
-
-
Save garethrees/3039032 to your computer and use it in GitHub Desktop.
Fake Time.now and Time.zone.now
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
| $start = Time.now - 1.month # this time last month | |
| class Time | |
| class << Time | |
| def new | |
| $start | |
| end | |
| def now | |
| Time.new | |
| end | |
| end | |
| end | |
| class TimeWithZone | |
| class << TimeWithZone | |
| def new | |
| $start | |
| end | |
| def now | |
| Time.new | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment