When shouldThrow fails from the wrong exception, we don't get to see what the message actually was.
unittest {
Throwable ex = null;
try {
shouldThrow(delegate() {
throw new Exception("Kablam!");
}, "Smack!");
} catch (Throwable exception) {
ex = exception;
}
ex.shouldNotBeNull();
// FIXME: We have no idea what the message actually was
ex.msg.shouldEqual("Exception was thrown. But expected: Smack!");
// Change it to
ex.msg.shouldEqual("Exception was thrown. Expected <Smack!> but got <Kablam!>");
}
When shouldThrow fails from the wrong exception, we don't get to see what the message actually was.