Recording Typhoeus :followlocation with VCR

308 views Asked by At

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.

1

There are 1 answers

1
Myron Marston On BEST ANSWER

We have an open issue about this:

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