Last active
August 29, 2015 14:03
-
-
Save urasandesu/ec14948c0f4f47497fed to your computer and use it in GitHub Desktop.
Refine Time.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
module Fake | |
refine Time.singleton_class do | |
def now | |
Time.local(2014, 1, 1) | |
end | |
end | |
end | |
def puts_original | |
p Time.now | |
end | |
using Fake | |
p Time.now # 2014-01-01 00:00:00 +0900 | |
puts_original # 2014-07-06 12:57:06 +0900 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment