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
12
# File 'lib/cucumber/formatter/rerun.rb', line 8

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

Instance Method Details

#after_test_case(test_case, result) ⇒ Object



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

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

#doneObject



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

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