Previously if a mock function raised BadArityError or
FunctionClauseError because of a bad mock, Apply would consider this
to be a failed application.
This can cause confusion when a test author creates a broken mock.
Instead of reporting an error about the mock code, the original code is
called.
Apply has gained a new helper, direct_exception?/2 which is used to
determine if the BadArityError or FunctionClauseError is being
raised by the application of the function or by the code in the
function.
Previously if a mock function raised
BadArityError
orFunctionClauseError
because of a bad mock, Apply would consider this to be a failed application.This can cause confusion when a test author creates a broken mock. Instead of reporting an error about the mock code, the original code is called.
Apply has gained a new helper,
direct_exception?/2
which is used to determine if theBadArityError
orFunctionClauseError
is being raised by the application of the function or by the code in the function.