Last active
September 2, 2015 19:20
-
-
Save seanlinsley/42d2e7760577305ec330 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
| def at(time) | |
| original = Time.now | |
| allow(Time).to receive(:now) { time } | |
| yield | |
| ensure | |
| allow(Time).to receive(:now) { original } | |
| end | |
| at 12.hours.from_now do | |
| # your test | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment