From 46be9d86a4e70c1c99f9fc193ba047f6266c56e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Wed, 15 Jul 2015 20:29:46 +0200 Subject: [PATCH] Revert interface change in Cucumber::Formatter::Console. Fixes #893. 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. --- lib/cucumber/formatter/console.rb | 7 ++++++- lib/cucumber/formatter/pretty.rb | 3 +-- lib/cucumber/formatter/progress.rb | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/cucumber/formatter/console.rb b/lib/cucumber/formatter/console.rb index 3675e2c6b4..a9d726737c 100644 --- a/lib/cucumber/formatter/console.rb +++ b/lib/cucumber/formatter/console.rb @@ -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]) diff --git a/lib/cucumber/formatter/pretty.rb b/lib/cucumber/formatter/pretty.rb index a681f5504b..510541d7a1 100644 --- a/lib/cucumber/formatter/pretty.rb +++ b/lib/cucumber/formatter/pretty.rb @@ -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 diff --git a/lib/cucumber/formatter/progress.rb b/lib/cucumber/formatter/progress.rb index 587cfc68db..8df43d0af0 100644 --- a/lib/cucumber/formatter/progress.rb +++ b/lib/cucumber/formatter/progress.rb @@ -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