lib/cucumber/formatters/pretty_formatter.rb in aslakhellesoy-cucumber-0.1.13 vs lib/cucumber/formatters/pretty_formatter.rb in aslakhellesoy-cucumber-0.1.13.2
- old
+ new
@@ -17,10 +17,12 @@
@pending_steps = []
@skipped = []
@last_executed_was_row = false
@pending_messages = {}
@forced_pending_step_count = 0
+
+ @total_scenario_count = 0
end
def feature_executing(feature)
@feature = feature
end
@@ -79,10 +81,11 @@
@io.puts
elsif scenario.row? && @scenario_failed
@io.puts
output_failing_step(@failed.last)
end
+ @total_scenario_count += 1
end
def step_passed(step, regexp, args)
if step.row?
args = step.visible_args if step.outline?
@@ -98,18 +101,17 @@
@io.puts
end
end
def step_failed(step, regexp, args)
+ @scenario_failed = true
if step.row?
args = step.visible_args if step.outline?
@failed << step
- @scenario_failed = true
print_failed_args(args)
else
@failed << step
- @scenario_failed = true
@io.print failed(" #{step.keyword} #{step.format(regexp){|param| failed_param(param) << failed}}")
if @options[:source]
@io.print padding_spaces(step)
@io.print source_comment(step)
end
@@ -174,10 +176,12 @@
def dump
@io.puts
print_pending_messages if @pending_messages.any?
+ @io.puts "#{@total_scenario_count} scenarios"
+
@io.puts pending("#{@pending_scenarios.length} scenarios pending") if @pending_scenarios.any?
@io.puts passed("#{@passed.length} steps passed") if @passed.any?
@io.puts failed("#{@failed.length} steps failed") if @failed.any?
@io.puts skipped("#{@skipped.length} steps skipped") if @skipped.any?
@@ -197,10 +201,10 @@
@pending_messages.each_value do |message|
@io.puts message
end
@io.puts
end
-
+
def print_snippets
snippets = @pending_steps
snippets.delete_if {|snippet| snippet.row? || @step_mother.has_step_definition?(snippet.name)}
unless snippets.empty?