seattlerb/minitest — pull request #150 by floehopper (2012-07-25 10:18:32+00:00)
Title: Add an `after_test` lifecycle hook for library developers.

- I'd like to be able to add assertions to the end of each test
via a MiniTest plugin.
- While I could do this one of the teardown hooks, this means that
since the teardown hooks are in an `ensure` block, my extra assertions
will *always* run even if an assertion fails within the test itself.
This then means it's possible to see multiple assertion failures in a
single test, which seems confusing.
- The `after_test` hook that I'm suggesting here is run immediately
after the test itself and is within the same `begin`/`rescue` block.

This patch solves the problem [I mentioned](https://github.com/seattlerb/minitest/pull/147#issuecomment-7136234) the other day in one of the other pull requests.

This hook would be really useful for integrating [Mocha](https://github.com/freerange/mocha) into MiniTest properly without having to do any monkey-patching.

I'm not sure `after_test` is the best name, because it doesn't convey that the hook is called _as part of_ the test. Perhaps `test_epilogue` or something would be better?

Thanks for all your help so far. It's much appreciated.