Skip to content

Instantly share code, notes, and snippets.

@HotFusionMan
Created September 8, 2012 05:51
Show Gist options
  • Save HotFusionMan/3672210 to your computer and use it in GitHub Desktop.
Save HotFusionMan/3672210 to your computer and use it in GitHub Desktop.
Use Clock wherever you would use Time. Edit as needed for testing purposes.
# Use Clock wherever you would use Time. Edit as needed for testing purposes. N.B. Remember that .now is a class method!!!
class Clock < Time
#def self.now
#super #.advance( :days => -1, :seconds => -1 ) # #advance is available in a Rails or ActiveSupport environment
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment