Sha256: 43e6c3b3e38bebaf4fc69bee14fd2d70c0eef028854d666e0befed28452c15a3

Contents?: true

Size: 840 Bytes

Versions: 7

Compression:

Stored size: 840 Bytes

Contents

When [allowing](./basics/allowing-messages) or [expecting](./basics/expecting-messages) messages, the default response is to return `nil`. Several
methods are provided to configure how the test double responds to the message.

* <a href="./configuring-responses/returning-a-value">`and_return`</a>
* <a href="./configuring-responses/raising-an-error">`and_raise`</a>
* <a href="./configuring-responses/throwing">`and_throw`</a>
* <a href="./configuring-responses/yielding">`and_yield`</a>
* <a href="./configuring-responses/calling-the-original-implementation">`and_call_original`</a>

In addition, you can provide a [block implementation](./configuring-responses/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.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opal-rspec-0.8.0 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.8.0.alpha3 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.8.0.alpha2 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.8.0.alpha1 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.7.1 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.7.0 rspec-mocks/upstream/features/configuring_responses/README.md
opal-rspec-0.7.0.rc.2 rspec-mocks/upstream/features/configuring_responses/README.md