djanowski/cutest — pull request #5 by satchmorun (2012-08-17 04:44:06+00:00)
Title: Run all tests in one go (vs. quit on first fail)

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.