Class: Cucumber::Formatter::Rerun

Inherits:
Object
  • Object
show all
Includes:
Io
Defined in:
lib/cucumber/formatter/rerun.rb

Instance Method Summary collapse

Methods included from Io

ensure_dir, ensure_file, ensure_io, included, io?, url?

Constructor Details

#initialize(config) ⇒ Rerun

Returns a new instance of Rerun.



11
12
13
14
15
16
17
# File 'lib/cucumber/formatter/rerun.rb', line 11

def initialize(config)
  @config = config
  @io = ensure_io(config.out_stream, config.error_stream)
  @repository = Cucumber::Repository.new
  @query = Cucumber::Query.new(@repository)
  config.on_event :envelope, &method(:output_envelope)
end

Instance Method Details

#output_envelope(event) ⇒ Object



19
20
21
22
23
# File 'lib/cucumber/formatter/rerun.rb', line 19

def output_envelope(event)
  envelope = event.envelope
  @repository.update(envelope)
  finish_report if envelope.test_run_finished
end