Skip to content

Run all tests in one go (vs. quit on first fail) #5

Closed
wants to merge 1 commit into from

3 participants

@satchmorun

Hi,

I like cutest and how simple it is, but I found myself wanting a couple of things:

  1. Results per test file
  2. Not to have the suite quit on the first failure

So this is a pull request that accomplishes those things. I'm not sure if it fits in with your roadmap, but I feel like its in line with what I perceive to be the philosophy of cutest, so I thought I'd send it over.

Description of changes

  1. Added a list of exceptions to the Thread.current[:cutest] Hash
  2. Moved the logic for catching/handling exceptions from run_file into test
  3. In the output, print the file name above the error line text (because i'm going to the file anyway and the line of code is often just an assert call)
  4. Added an E result for non-Cutest::AssertionFailed exceptions that are caught.

(it sounds like a lot, but it actually isn't all that much - and I updated the relevant tests so that everything's passing)

One nice result is that assertion methods no longer have to do IO to report on their status - they just need to flunk if some conditions aren't met, so the only changes to user code this pull request might require are in custom assertions - removing any calls to success.

Feel free to let me know what you think, I'd love to hear it.

@satchmorun satchmorun Run all tests in one go (vs. quit on first fail)
Changes output to show dots for each file under test
and then display the error/traces.
6da6b5f
@frodsan
frodsan commented May 29, 2014

.2 is intented.

@djanowski
Owner

Sorry, fail fast is a feature.

That said, I also envision Cutest as a spec, so I encourage you to write your own runner with this behavior.

@djanowski djanowski closed this May 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.