Module: Crabfarm::Modes::Recorder::Snapshot

Extended by:
Snapshot
Included in:
Snapshot
Defined in:
lib/crabfarm/modes/recorder/snapshot.rb

Instance Method Summary collapse

Instance Method Details

#start(_context, _navigator) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/crabfarm/modes/recorder/snapshot.rb', line 13

def start(_context, _navigator)
  return puts "Must provide a navigator name" unless _navigator.is_a? String

  begin
    puts "Navigating using last #{_navigator} spec, waiting to hit a reducer...".color(Console::Colors::NOTICE)
    Factories::Reducer.with_decorator Shared::SnapshotDecorator do
      @example = Utils::RSpecRunner.run_single_spec_for spec_for(_navigator)
    end
    puts "Navigation completed".color(Console::Colors::NOTICE)
  rescue Exception => e
    puts "#{e.to_s}".color Console::Colors::ERROR
    puts e.backtrace
  end
end