Once you do that, there is no going back. You could alter it to alias_method the original return methods to undo it later, but just commenting/uncommenting that block works for me, since it is only for the rare situation that we have a test that only fails on one day of the week.
# Simulate tests running on Saturday to check for day of week issues. Timecop.baseline = DateTime.now + (6 - Time.now.wday).days class Timecop # return typically "unmock!"'s and goes back to real time, but we don't want that, # so make it act like return_to_baseline in class and instance. class << self; alias_method :return, :return_to_baseline; end alias_method :return, :return_to_baseline end
If you already make sure of baseline in your tests and use return_to_baseless, obviously don't redefine Timecop's return method like this. Redefining return may make it more difficult for the Timecop team to help you with support requests, so please use it only temporarily as needed, and don't say I didn't warn you.