Created
August 30, 2011 22:19
-
-
Save robhanlon22/1182257 to your computer and use it in GitHub Desktop.
Failure dumping progress formatter for RSpec 2.6.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec/core/formatters/progress_formatter' | |
module RSpec | |
module Core | |
module Formatters | |
class FailureDumpingProgressFormatter < RSpec::Core::Formatters::ProgressFormatter | |
def initialize(output) | |
super(output) | |
@base_text_formatter = RSpec::Core::Formatters::BaseTextFormatter.new(output) | |
@failure_count = 0 | |
end | |
def example_failed(example) | |
output.puts | |
super(example) | |
output.puts | |
@base_text_formatter.send(:dump_failure, example, @failure_count) | |
@base_text_formatter.send(:dump_backtrace, example) | |
@failure_count += 1 | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment