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

Constructor Details

#initialize(runtime, path_or_io, options) ⇒ Rerun

Returns a new instance of Rerun.



8
9
10
11
# File 'lib/cucumber/formatter/rerun.rb', line 8

def initialize(runtime, path_or_io, options)
  @io = ensure_io(path_or_io, "rerun")
  @failures = {}
end

Instance Method Details

#after_test_case(test_case, result) ⇒ Object



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

def after_test_case(test_case, result)
  return if result.passed?
  @failures[test_case.location.file] ||= []
  @failures[test_case.location.file] << test_case.location.line
end

#doneObject



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

def done
  return if @failures.empty?
  @io.print file_failures.join(' ')
end