HTTPS clone URL
Subversion checkout URL
A Rails plugin that makes it easy to write tests or specs for time-dependent code
Fetching latest commit…
Cannot retrieve the latest commit at this time
|Failed to load latest commit information.|
= TimeTravel This lets you set the current time in your tests or specs, so you can do things like: at_time("1 April 2020 2:32 UTC") do # some fancy code end Inside the block, Time.now will return the time you provide. The time will be restored to normal system time when the block exits, even if it throws an exception. The at_time function can take a Time object, or a string to parse into a time. TimeTravel is only loaded in the Rails test environment. If you need it in your development environment, just require 'time_travel'.