Module: TemporalHelpers
- Defined in:
- lib/cucumber/timecop.rb
Overview
TemporalHelpers module group all the needed methods to use Timecop with Cucumber
Instance Method Summary collapse
-
#freeze_time_at(time, &block) ⇒ Object
Travels to and freezes the clock at
time
. -
#travel_to(time, &block) ⇒ Object
Travels to
time
and lets the clock keep running.
Instance Method Details
#freeze_time_at(time, &block) ⇒ Object
Travels to and freezes the clock at time
.
If a block is given, executes the block at that time then returns to the present.
23 24 25 |
# File 'lib/cucumber/timecop.rb', line 23 def freeze_time_at(time, &block) Timecop.freeze parse_time(time), &block end |
#travel_to(time, &block) ⇒ Object
Travels to time
and lets the clock keep running.
If a block is given, executes the block at that time then returns to the present.
15 16 17 |
# File 'lib/cucumber/timecop.rb', line 15 def travel_to(time, &block) Timecop.travel parse_time(time), &block end |