package mock
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Mock
Source
A mock is something that can be used in place of function.
('args, 'ret) t
is similar to 'args -> 'ret
except that:
- its return value (or effect) can be configured
- it is possible to determine whether it has been called
Build an unconfigured mock. Calling an unconfigured mock will raise an exception that contains the name of the mock.
What a mock can evaluate to.
Evaluation is not possible. call
will raise Mock_non_configured
.
Return a value.
Raise an exception.
Define what a mock should return.
Call the mock:
- record its arguments
- perform its side effects
call
will raise this exception if the mock has not been configured.