Created
May 21, 2010 05:11
-
-
Save ql/408489 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'spec/runner/formatter/base_text_formatter' | |
| module Spec | |
| module Runner | |
| module Formatter | |
| class FailingExamplesBacktrace < BaseTextFormatter | |
| def example_failed(example, counter, failure) | |
| @output.puts "#{example_group.description} #{example.description}" | |
| @output.flush | |
| end | |
| def dump_failure(counter, failure) | |
| @output.puts | |
| @output.puts "#{counter.to_s})" | |
| @output.puts colorize_failure("#{failure.header}\n#{failure.exception.message}", failure) | |
| @output.puts format_backtrace(failure.exception.backtrace) | |
| @output.flush | |
| end | |
| def dump_summary(duration, example_count, failure_count, pending_count) | |
| return if dry_run? | |
| @output.puts | |
| @output.puts "Finished in #{duration} seconds" | |
| @output.puts | |
| summary = "#{example_count} example#{'s' unless example_count == 1}, #{failure_count} failure#{'s' unless failure_count == 1}" | |
| summary << ", #{pending_count} pending" if pending_count > 0 | |
| @output.puts summary | |
| @output.flush | |
| end | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment