Skip to content

Commit

Permalink
Revert interface change in Cucumber::Formatter::Console. Fixes #893.
Browse files Browse the repository at this point in the history
Change Console.print_stats back to expecting features and options as
arguments. Instead introduce Console.print_statistics for use in new
formatter API formatters, where LegacyApi::Ast::Features cannot be used.
  • Loading branch information
brasmusson committed Jul 15, 2015
1 parent ff6e291 commit 46be9d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/cucumber/formatter/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ def print_elements(elements, status, kind)
end
end

def print_stats(duration, options)
def print_stats(features, options)
duration = features ? features.duration : nil
print_statistics(duration, options)
end

def print_statistics(duration, options)
failures = collect_failing_scenarios(runtime)
if !failures.empty?
print_failing_scenarios(failures, options.custom_profiles, options[:source])
Expand Down
3 changes: 1 addition & 2 deletions lib/cucumber/formatter/pretty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ def cell_prefix(status)
end

def print_summary(features)
duration = features ? features.duration : nil
print_stats(duration, @options)
print_stats(features, @options)
print_snippets(@options)
print_passing_wip(@options)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/progress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def done
def print_summary
print_steps(:pending)
print_steps(:failed)
print_stats(@total_duration, @options)
print_statistics(@total_duration, @options)
print_snippets(@options)
print_passing_wip(@options)
end
Expand Down

0 comments on commit 46be9d8

Please sign in to comment.