Closed jonathan-s closed 7 years ago
So the answer here is unfortunately not.
Capturing and replaying these exceptions was never quite in scope for Betamax. It'd be rather difficult for us to make it work correctly every-time especially when Betamax is more concerned with the validity of the data, headers, etc. in the Response than anything else.
Thanks for the reply :). I almost guessed as much.
For this kind of testing I tend to suggest something like Mock, but I understand you're not trying to assert the handling of the ConnectionError necessarily you're just trying to test something with this in it and Betamax is hindering that. I'm sorry for that. :(
Yeah pretty much. One testcase less, it's not the end of the world. Thanks a lot for making betamax though, really helpful!
Thanks a lot for making betamax though, really helpful!
I'm glad to hear that! I'm going to close this for now. Let me know if we need to reopen it.
I have a situation which is a bit of an edge case. The url I was hitting was always throwing a
ConnectionError
because the service redirected to another url and that url happened to be a non-valid url. So I'm more or less doing the followingRecording the cassette is fine, but when you try to replay it it will complain that
https://example.com
is not in the cassette. Do you have any suggestion for this?