Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastFail option for DefaultReporter #44

Merged
merged 2 commits into from
Dec 27, 2012

Conversation

chiku
Copy link
Contributor

@chiku chiku commented Dec 26, 2012

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

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

kern pushed a commit that referenced this pull request Dec 27, 2012
FastFail option for DefaultReporter
@kern kern merged commit 9190a50 into minitest-reporters:develop Dec 27, 2012
@kern
Copy link
Collaborator

kern commented Dec 27, 2012

Perfect! Thanks for this. I'll eventually get around to refactoring the reporters. There's a ton of messy code that could be factored out of DefaultReporter in particular.

Pushed in 0.14.0.

@jmarceli jmarceli mentioned this pull request Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants