Revisions

gist: 225991 Download_button fork
public
Description:
See http://daniel.collectiveidea.com/blog/2009/11/4/helpful-cucumber-steps
Public Clone URL: git://gist.github.com/225991.git
Embed All Files: show embed
time_steps.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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