Question

Suppose, I have a request to google.com. I can record a cassette and use. But imagine situation when I need to test suite when google.com returns a 500 error code? How could it be done? I thought about manual change of the cassette file, but when I need to re-record all the cassettes I will need to change this cassette also and this does not suit my need 'cause I have lots of such cases

Or are there any alternatives to vcr which let do so?

Was it helpful?

Solution 2

When you need a response that is not easily recordable, VCR is not the right tool. I recommend you use WebMock or the stubbing facilitates built-in to your HTTP library. (Excon, Faraday and Typhoeus all have built-in stubbing APIs).

OTHER TIPS

maybe this can help you:

http://railsware.com/blog/2013/10/03/custom-vcr-matchers-for-dealing-with-mutable-http-requests/

I am not sure because your question is vague. but hope it helps :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top