class Cucumber::Formatter::Rerun

Public Class Methods

new(config) click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 9
def initialize(config)
  @io = ensure_io(config.out_stream)
  @config = config
  @failures = {}
  config.on_event :test_case_finished do |event|
    test_case, result = *event.attributes
    next if result.ok?(@config.strict)
    @failures[test_case.location.file] ||= []
    @failures[test_case.location.file] << test_case.location.line
  end
  config.on_event :test_run_finished do
    next if @failures.empty?
    @io.print file_failures.join("\n")
  end
end

Private Instance Methods

file_failures() click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 27
def file_failures
  @failures.map { |file, lines| [file, lines].join(':') }
end