CapnKernul/minitest-reporters — pull request #44 by chiku (2012-12-26 13:19:31+00:00)
Title: FastFail option for DefaultReporter

See the failure messages immediately while still running test suite with red-green style (dotted) format.

This is inspired from rspec-instafail https://github.com/grosser/rspec-instafail

When fast-fail is enabled, full messages would be printed on a test failure or errors. These failure messages are similar to those produced by SpecReporter.

The failure messages that DefaultReporter displays at the end of a test run are suppressed, since it would be redundant information.

The option to generate a fast-fail run is

```ruby
MiniTest::Reporters.use! MiniTest::Reporters::DefaultReporter.new(:fast_fail => true)
```

And the output looks like

```
# Running tests:

MiniTestReportersTest::BadTest
test_b FAIL
--- expected
+++ actual
@@ -1,2 +1,2 @@
"ab
-c"
+d"
/Users/chirantan/personal_projects/minitest-reporters/test/gallery/bad_test.rb:14:in `test_b'

MiniTestReportersTest::BadTest
test_a FAIL
Expected: 1
Actual: 2
/Users/chirantan/personal_projects/minitest-reporters/test/gallery/bad_test.rb:6:in `test_a'

MiniTestReportersTest::BadTest
test_boom ERROR
A random exception
/Users/chirantan/personal_projects/minitest-reporters/test/gallery/bad_test.rb:18:in `test_boom'
S..

Finished tests in 0.023226s, 258.3312 tests/s, 215.2760 assertions/s.

6 tests, 5 assertions, 2 failures, 1 errors, 1 skips
```