myronmarston/vcr — pull request #172 by tylerhunt (2012-05-29 23:38:24+00:00)
Title: Fix multipart POST requests with Faraday.

VCR isn't properly storing the request body when recording Faraday multipart POST requests. This then causes the matching to fail when using `match_requests_on` with `:body`.

The issue is that Faraday uses the `multipart-post` Gem and returns an instance of `CompositeReadIO` as the request body. Faraday is then calling `#to_s` on the body to "Ensure that the body is a raw string" (`lib/vcr/structs.rb:73`). This causes Farday to store something like `#` as the request body instead of the actual body Faraday uses by calling `#read` on the body object.

The fix here gets things working, but may not fix it in the best way possible. As I'm new to the VCR codebase, I also wasn't able to determine where or how to write a test for this.