class Cucumber::Formatter::Summary
Summary
formatter, outputting only feature / scenario titles
Public Class Methods
new(config)
click to toggle source
# File lib/cucumber/formatter/summary.rb, line 16 def initialize(config) @config, @io = config, ensure_io(config.out_stream) @counts = ConsoleCounts.new(@config) @issues = ConsoleIssues.new(@config) @start_time = Time.now @config.on_event :test_case_started do |event| print_feature event.test_case print_test_case event.test_case end @config.on_event :test_case_finished do |event| print_result event.result end @config.on_event :test_run_finished do |event| duration = Time.now - @start_time @io.puts print_statistics(duration, @config, @counts, @issues) end end
Private Instance Methods
print_feature(test_case)
click to toggle source
# File lib/cucumber/formatter/summary.rb, line 40 def print_feature(test_case) feature = test_case.feature return if @current_feature == feature @io.puts unless @current_feature.nil? @io.puts feature @current_feature = feature end
print_result(result)
click to toggle source
# File lib/cucumber/formatter/summary.rb, line 52 def print_result(result) @io.puts format_string(result, result.to_sym) end
print_test_case(test_case)
click to toggle source
# File lib/cucumber/formatter/summary.rb, line 48 def print_test_case(test_case) @io.print " #{test_case.name} " end