Skip to content

Commit

Permalink
Show rspec summary of failures
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Mar 11, 2013
1 parent a37544c commit d3707dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/fivemat/rspec.rb
Expand Up @@ -8,6 +8,7 @@ def initialize(*)
super
@group_level = 0
@index_offset = 0
@cumulative_failed_examples = []
end

def example_group_started(group)
Expand All @@ -34,6 +35,7 @@ def example_group_finished(group)
dump_backtrace(example)
end
@index_offset += failed_examples.size
@cumulative_failed_examples += failed_examples
failed_examples.clear
end
end
Expand All @@ -51,6 +53,11 @@ def dump_pending_fixed(example, index)
output.puts blue("#{long_padding}Expected pending '#{example.metadata[:execution_result][:pending_message]}' to fail. No Error was raised.")
end

def dump_summary(*)
@failed_examples = @cumulative_failed_examples
super
end

def start_dump
# Skip the call to output.puts in the messiest way possible.
self.class.superclass.superclass.instance_method(:start_dump).bind(self).call
Expand Down

0 comments on commit d3707dc

Please sign in to comment.