Skip to content

Instantly share code, notes, and snippets.

@urasandesu
Last active August 29, 2015 14:03
Show Gist options
  • Save urasandesu/ec14948c0f4f47497fed to your computer and use it in GitHub Desktop.
Save urasandesu/ec14948c0f4f47497fed to your computer and use it in GitHub Desktop.
Refine Time.now
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