Skip to main content

Configuring responses

When allowing or expecting messages, the default response is to return nil. Several methods are provided to configure how the test double responds to the message.

In addition, you can provide a block implementation to respond in any manner you wish.

Note: for simplicity, the examples here use allow rather than expect, but these APIs apply equally to both cases.