Parent

Included Modules

Class/Module Index [+]

Quicksearch

Cucumber::Formatter::Rerun

The formatter used for --format rerun

This formatter keeps track of all failing features and print out their location. Example:

features/foo.feature:34 features/bar.feature:11:76:81

This formatter is used by AutoTest - it will use the output to decide what to run the next time, simply passing the output string on the command line.

Public Class Methods

new(step_mother, path_or_io, options) click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 18
def initialize(step_mother, path_or_io, options)
  @io = ensure_io(path_or_io, "rerun")
  @options = options
  @file_names = []
  @file_colon_lines = Hash.new{|h,k| h[k] = []}
end

Public Instance Methods

after_feature_element(feature_element) click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 42
def after_feature_element(feature_element)
  if @rerun
    file, line = *feature_element.file_colon_line.split(':')
    @file_colon_lines[file] << line
    @file_names << file
  end
end
after_features(features) click to toggle source

features() is never executed at all… ?

# File lib/cucumber/formatter/rerun.rb, line 26
def after_features(features)
  files = @file_names.uniq.map do |file|
    lines = @file_colon_lines[file]
    "#{file}:#{lines.join(':')}"
  end
  @io.puts files.join(' ')
  
  # Flusing output to rerun tempfile here...
  @io.flush
  @io.close
end
before_feature_element(feature_element) click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 38
def before_feature_element(feature_element)
  @rerun = false
end
step_name(keyword, step_match, status, source_indent, background) click to toggle source
# File lib/cucumber/formatter/rerun.rb, line 50
def step_name(keyword, step_match, status, source_indent, background)
  @rerun = true if [:failed, :pending, :undefined].index(status)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.