Current implementation means that all the "after all" tear down action happen during global destruction. This means that the "after all" for a nested describe is not run before the examples in a subsequent nested describe. This adjusted implementation will "after all" blocks after the last test within their context, but before the examples of any subsequent contexts. This does come at a performance cost, as after ever test we need to check to see if the next test (if there is one) is in a sibling or parent context. However by my observation, this performance cost is negligible in the context or running unit tests.
It is not as graceful a solution as allowing global destruction to trigger the "after all" tasks, but it does result in execution of these blocks at what I'd consider to be the expected time during execution.
Current implementation means that all the "after all" tear down action happen during global destruction. This means that the "after all" for a nested describe is not run before the examples in a subsequent nested describe. This adjusted implementation will "after all" blocks after the last test within their context, but before the examples of any subsequent contexts. This does come at a performance cost, as after ever test we need to check to see if the next test (if there is one) is in a sibling or parent context. However by my observation, this performance cost is negligible in the context or running unit tests.
It is not as graceful a solution as allowing global destruction to trigger the "after all" tasks, but it does result in execution of these blocks at what I'd consider to be the expected time during execution.