Guest User

Untitled

a guest
Apr 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Given /^(.+) (\d+) (seconds?|minutes?|hours?|days?|months?|years?) (ago|from now)$/ do |string, number, time_unit, time_direction|
  2. Timecop.freeze(number.to_i.send(time_unit).send(time_direction.gsub(' ','_'))) do
  3. Given string
  4. end
  5. end
Add Comment
Please, Sign In to add comment