Cassandane::JMAPAbort

NAME

Cassandane::JMAPAbort - a JMAP::Tester abort that Test::Unit calls a failure

DESCRIPTION

When JMAP::Tester gives up, it throws a JMAP::Tester::Abort, which is a Throwable::Error. Test::Unit only understands Error.pm exceptions, and of those only a Test::Unit::Failure is reported as a failing test; anything else is an error, meaning the test suite itself is broken. An abort is a failingtest, so it should look like one.

This stupid class saves us from multiple inheritance, and Cassandane::Role::JMAPTester makes our JMAP::Tester classes use it.

METHODS

new

Cassandane::JMAPAbort->new($message);
Cassandane::JMAPAbort->new({ message => $message, diagnostics => \@diags });

Those are the two ways JMAP::Tester builds an abort. The diagnostics have already been formatted by the tester's diagnostic dumper, and get folded into the message, because the message is all that Test::Unit will ever show.

Called any other way, we assume we've been given the usual Error.pm arguments. That happens when Test::Unit::Assert rethrows an exception to blame the caller of an assertion, which it does by passing our own guts back to new.