Describe clearing cached stubs

This was the solution proposed in https://github.com/lostisland/faraday/issues/1041
This commit is contained in:
Stanisław Pitucha 2019-10-02 11:18:24 +10:00 committed by Olle Jonsson
parent 940e01ce38
commit cccc145e2f

View File

@ -72,6 +72,14 @@ verify the order or count of any stub.
stubs.verify_stubbed_calls
```
After the test case is completed (possibly in an `after` hook), you should clear
the default connection to prevent it from being cached between different tests.
This allows for each test to have its own set of stubs
```ruby
Faraday.default_connection = nil
```
## Examples
Working [RSpec] and [test/unit] examples for a fictional JSON API client are