Skip to content

Instantly share code, notes, and snippets.

@webgago
Forked from danielmorrison/time_steps.rb
Created October 22, 2010 07:59
Show Gist options
  • Save webgago/640139 to your computer and use it in GitHub Desktop.
Save webgago/640139 to your computer and use it in GitHub Desktop.
timecop_steps
# just add a gem dependency for Timecop or require it yourself
Given 'the time is $time' do |time|
Timecop.freeze Time.parse(time)
end
When '$time pass' do |time|
Timecop.travel future_time(time)
Given 'delayed jobs are run' # we use delayed jobs and have some that get scheduled in the future.
end
When 'time stands still' do
Timecop.freeze Time.now
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment