Clear cached webmock response in HTTPClient instance. #199

Merged
merged 1 commit into from Aug 14, 2012

3 participants

@myronmarston
Collaborator

When the a request was not stubbed, the nil value of the webmock response was
being cached in the webmock_responses hash. Then, when a second request was
made with the same HTTPClient instance and an identical signature, it was not
checking for a stub again, even though there may have been one for the second request (e.g. when using a global stub hook or if another stub is registered between the 1st and 2nd requests).

Fixes myronmarston/vcr#190.

@myronmarston myronmarston Clear cached webmock response in HTTPClient instance.
When the a request was not stubbed, the `nil` value of the webmock response was
being cached in the `webmock_responses` hash. Then, when a second request was 
made with the same HTTPClient instance and an identical signature, it was not 
checking for a stub again, even though there may have been one for the second request (e.g. when using a global stub hook or if another stub is registered between the 1st and 2nd requests).

Fixes myronmarston/vcr#190.
653d92f
@bblimke bblimke merged commit 430f60d into master Aug 14, 2012
@bblimke
Owner

Thank you Myron. The fact that this code requires a comment to work, suggests there is a better way to do it.
I can't think of a better way though. There is a problem of a new response for the same signature being regiestered between two asynchronous requests and I don't know how to solve it differently.

@jrochkind

I'm confused, has this fix actually been merged in? Will it be in the next WebMock patch release? I'm the original reporter over in VCR issue tracker, hoping a fix is in the release pipeline. Thanks!

@myronmarston
Collaborator

Yep, looks like it's in the 1.8.9 release:

v1.8.8...v1.8.9

@jrochkind
@jrochkind
@davidbegin davidbegin deleted the vcr-issue-190 branch May 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment