My test suite records a few different types of connections, one through the bitly gem and the others via Typhoeus.

For some reason, when I use Typhoeus' :followlocation option,

Typhoeus.get(url, :followlocation => true)

the VCR cassette logs the initial url as well as a binary response, which causes subsequent tests run from the cassette to fail.

Previously, I was using Net::HTTP to follow redirects, and each hop was recorded, allowing VCR to properly replay each hop.

How can I get VCR to respond correctly to Typhoeus' response?

Here's the file containing the culprit recording (for the tinyurl link).

The alternative I see is to just not record those requests and require the test suite to hit the real site each time. It's not ideal (or a real solution), but it gets my tests passing.

有帮助吗?

解决方案

We have an open issue about this:

https://github.com/vcr/vcr/issues/293

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top