class Cucumber::Formatter::Progress

The formatter used for --format progress

Constants

CHARS

Attributes

runtime[R]

Public Class Methods

new(runtime, path_or_io, options) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 14
def initialize(runtime, path_or_io, options)
  @runtime, @io, @options = runtime, ensure_io(path_or_io), options
  @previous_step_keyword = nil
  @snippets_input = []
  @total_duration = 0
end

Public Instance Methods

after_test_case(_test_case, result) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 34
def after_test_case(_test_case, result)
  @total_duration += DurationExtractor.new(result).result_duration
end
after_test_step(test_step, result) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 29
def after_test_step(test_step, result)
  progress(result.to_sym) if !HookQueryVisitor.new(test_step).hook? || result.failed?
  collect_snippet_data(test_step, result) unless HookQueryVisitor.new(test_step).hook?
end
before_test_case(_test_case) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 21
def before_test_case(_test_case)
  unless @profile_information_printed
    print_profile_information
    @profile_information_printed = true
  end
  @previous_step_keyword = nil
end
done() click to toggle source
# File lib/cucumber/formatter/progress.rb, line 38
def done
  @io.puts
  @io.puts
  print_summary
end

Private Instance Methods

print_summary() click to toggle source
progress(status) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 62
def progress(status)
  char = CHARS[status]
  @io.print(format_string(char, status))
  @io.flush
end
table_header_cell?(status) click to toggle source
# File lib/cucumber/formatter/progress.rb, line 68
def table_header_cell?(status)
  status == :skipped_param
end