Skip to content

Instantly share code, notes, and snippets.

@robhanlon22
Created August 30, 2011 22:19
Show Gist options
  • Save robhanlon22/1182257 to your computer and use it in GitHub Desktop.
Save robhanlon22/1182257 to your computer and use it in GitHub Desktop.
Failure dumping progress formatter for RSpec 2.6.3
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