Sha256: ed5519c10786b7602de698779b2cd9aefda2d7ca8d2e8a65c0404d7e9f4b2dda

Contents?: true

Size: 1.2 KB

Versions: 34

Compression:

Stored size: 1.2 KB

Contents

#!/usr/bin/env ruby

require 'delorean'
require 'chronic'
require 'active_support/time'

When /^(.+) passes$/ do |time|
  period = Chronic.parse("#{time} from now")
  RedisDelorean.time_travel_to(period)
  #puts "Time Travelled to #{Time.now.to_s}"
end

# Given /^I time travel to (.+)$/ do |period|
#   RedisDelorean.time_travel_to(period)
#   # puts "Time Travelled to #{Time.now.to_s}"
# end

Given /^the timezone is (.*)$/ do |tz|
  Time.zone = tz
  Chronic.time_class = Time.zone
end

Given /^the time is (.*)$/ do |time|
  RedisDelorean.time_travel_to(Chronic.parse("#{time}"))
  #puts "Time Travelled to #{Time.now.to_s}"
end

# Given /^I come back to the present$/ do
#   RedisDelorean.back_to_the_present
#   # puts "Time Travelled to the present, #{Time.now.to_s}"
# end

# Given /^I time travel in (.+) to (.+)$/ do |zone_name, timestamp|
#   zone = ::Time.find_zone!(zone_name)
#   time = zone.parse timestamp
#   RedisDelorean.time_travel_to time
#   # puts "Time Travelled to #{Time.now.to_s}"
# end

# Then /^the time in UTC should be about (.+)$/ do |timestamp|
#   actual = Time.now.in_time_zone('UTC')
#   expected = Time.parse("#{timestamp} UTC")
#   (expected..expected+5).cover?(actual).should be_true
# end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
flapjack-0.7.35 features/steps/time_travel_steps.rb
flapjack-0.7.34 features/steps/time_travel_steps.rb
flapjack-0.7.33 features/steps/time_travel_steps.rb
flapjack-0.7.32 features/steps/time_travel_steps.rb
flapjack-0.7.31 features/steps/time_travel_steps.rb
flapjack-0.7.30 features/steps/time_travel_steps.rb
flapjack-0.7.29 features/steps/time_travel_steps.rb
flapjack-0.7.28 features/steps/time_travel_steps.rb
flapjack-0.7.27 features/steps/time_travel_steps.rb
flapjack-0.7.26 features/steps/time_travel_steps.rb
flapjack-0.7.25 features/steps/time_travel_steps.rb
flapjack-0.7.22 features/steps/time_travel_steps.rb
flapjack-0.7.21 features/steps/time_travel_steps.rb
flapjack-0.7.20 features/steps/time_travel_steps.rb
flapjack-0.7.19 features/steps/time_travel_steps.rb
flapjack-0.7.18 features/steps/time_travel_steps.rb
flapjack-0.7.17 features/steps/time_travel_steps.rb
flapjack-0.7.16 features/steps/time_travel_steps.rb
flapjack-0.7.15 features/steps/time_travel_steps.rb
flapjack-0.7.14 features/steps/time_travel_steps.rb