Class: Timecop::Rspec::SequentialTimeMachine
- Inherits:
-
Object
- Object
- Timecop::Rspec::SequentialTimeMachine
- Defined in:
- lib/timecop/rspec/sequential_time_machine.rb
Overview
Executes examples while allowing time travel to continue across examples.
Uses TravelLog to coalesce sequential :travel operations when the same method and start time are reused, enabling long-running time journeys across multiple examples.
Class Method Summary collapse
-
.instance ⇒ Timecop::Rspec::SequentialTimeMachine
Singleton instance accessor.
Instance Method Summary collapse
-
#run(example) ⇒ Object
Run an example with either local or global travel, or without any timecop.
Class Method Details
.instance ⇒ Timecop::Rspec::SequentialTimeMachine
Singleton instance accessor.
15 16 17 |
# File 'lib/timecop/rspec/sequential_time_machine.rb', line 15 def self.instance @instance ||= new end |
Instance Method Details
#run(example) ⇒ Object
Run an example with either local or global travel, or without any timecop.
22 23 24 25 26 |
# File 'lib/timecop/rspec/sequential_time_machine.rb', line 22 def run(example) example = ExampleDecorator.new(example) runner_for(example).run end |