Don't crash after aborted test

Hi.

This patch is very useful.
Can you include this into next release of the gem?