seattlerb/minitest — pull request #221 by randycoulman (2013-01-13 00:03:36+00:00)
Title: Unit: Errors in teardown are not recorded

When an error or assertion failure occurs in a `teardown` method, it is not recorded correctly. That is, `record` has been sent with the passing test information before `teardown` is sent, and no further information is recorded after that. This doesn't affect the standard runner, because it relies on `puke` to do its job. But it affects other runners that rely on `record` instead, such as [minitest-reporters](https://github.com/CapnKernul/minitest-reporters).

This pull request consists of three commits:

1. Add test coverage around the current incorrect behavior of `record`. There may be a better way to write these tests.
2. Modify the relevant test to have the desired new behavior.
3. (Optional) If an error/assertion failure is raised in both the test body and `teardown`, record the one from the test body.

See also the [related issue](https://github.com/CapnKernul/minitest-reporters/issues/49) I filed for minitest-reporters.