Skip to content

Instantly share code, notes, and snippets.

@mstahl
Created October 7, 2011 18:28
Show Gist options
  • Save mstahl/1271019 to your computer and use it in GitHub Desktop.
Save mstahl/1271019 to your computer and use it in GitHub Desktop.
Simple Cucumber test steps for using Delorean for time travel
When /^(?:I )?travel (?:forward|backward) in time to (\d+) (years?|months?|weeks?|days?) (from now|ago)$/ do |amount, unit, direction|
Delorean.time_travel_to (amount.to_i).send(unit.to_sym).send(direction.gsub(/\s/, "_").to_sym)
end
Then /^(?:I )?travel in time to the present$/ do
Delorean.back_to_the_present
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment