class Timecop

We directly patch Timecop class instead of mixin module since Singleton classes cannot be extended. github.com/ruby/ruby/blob/v2_5_0/lib/singleton.rb#L150-L151

Public Instance Methods

travel(*args, &block)
Also aliased as: travel_without_redis
Alias for: travel_with_redis
travel_with_redis(*args, &block) click to toggle source
# File lib/timecop/redis/timecop_integration.rb, line 9
def travel_with_redis(*args, &block)
  if Timecop::Redis.integrate_into_timecop_travel?
    old_time = Time.now
    travel_without_redis(*args, &block)
    new_time = Time.now
    Timecop::Redis.traveler.travel(from: old_time, to: new_time, &block)
  else
    travel_without_redis(*args, &block)
  end
end
Also aliased as: travel
travel_without_redis(*args, &block)
Alias for: travel