DefaultFailureHandler class
class DefaultFailureHandler implements FailureHandler { DefaultFailureHandler() { if (_assertErrorFormatter == null) { _assertErrorFormatter = _defaultErrorFormatter; } } void fail(String reason) { throw new ExpectException(reason); } void failMatch(actual, Matcher matcher, String reason, MatchState matchState, bool verbose) { fail(_assertErrorFormatter(actual, matcher, reason, matchState, verbose)); } }
Implements
Constructors
new DefaultFailureHandler() #
DefaultFailureHandler() { if (_assertErrorFormatter == null) { _assertErrorFormatter = _defaultErrorFormatter; } }
Methods
void fail(String reason) #
This handles failures given a textual decription
void fail(String reason) { throw new ExpectException(reason); }
void failMatch(actual, Matcher matcher, String reason, MatchState matchState, bool verbose) #
This handles failures given the actual value
, the
matcher
the
reason (argument from expect), some additonal
matchState
generated by the
matcher, and a verbose flag which controls in
some cases how much
matchState information is used. It will use
these to create a detailed error message (typically by calling
an ErrorFormatter) and then call fail with this message.
void failMatch(actual, Matcher matcher, String reason, MatchState matchState, bool verbose) { fail(_assertErrorFormatter(actual, matcher, reason, matchState, verbose)); }