class Cucumber::Formatter::Steps

The formatter used for --format steps

Public Class Methods

new(runtime, path_or_io, options) click to toggle source
# File lib/cucumber/formatter/steps.rb, line 9
def initialize(runtime, path_or_io, options)
  @io = ensure_io(path_or_io, nil)
  @options = options
  @step_definition_files = collect_steps(runtime)
end

Public Instance Methods

after_features(_features) click to toggle source
# File lib/cucumber/formatter/steps.rb, line 15
def after_features(_features)
  print_summary
end

Private Instance Methods

collect_steps(runtime) click to toggle source
# File lib/cucumber/formatter/steps.rb, line 39
def collect_steps(runtime)
  runtime.step_definitions.each_with_object({}) do |step_definition, step_definitions|
    step_definitions[step_definition.file] ||= []
    step_definitions[step_definition.file] << [step_definition.file_colon_line, step_definition.regexp_source]
  end
end
print_summary() click to toggle source
source_indent(sources) click to toggle source
# File lib/cucumber/formatter/steps.rb, line 46
def source_indent(sources)
  sources.map { |_file_colon_line, regexp| regexp.size }.max + 1
end