Closed fotinakis closed 8 years ago
See #336 which has some related info.
Great, thanks! Looks like https://github.com/bblimke/webmock/pull/582 will fix this issue in the next WebMock release.
The newly released WebMock 1.23.0 fixes this issue. I've upgraded and deleted the spec_helper fix noted above, things work great by default.
Just an FYI issue, not sure what the best solution is here. I think this is a bad interaction between WebMock and google-api-client.
I use VCR and WebMock underneath to record and replay all interactions with Google APIs in tests. Ever since upgrading from google-api-client
0.9.pre3
to0.9.1
all of my integration tests would break with:It turns out that
JSON::ParserError
is raised when given a blank string to decode. After digging in, sure enough all of my VCR cassette files had recorded responses with empty response body (even though Content-Length would still be correct).I dug through your spec_helper and found the monkey-patch for WebMock to support chunked responses—I thought that was it, but it turns out that I didn't need that, I only needed to add:
With that in my
spec_helper.rb
, everything works again because my cassettes record full response bodies again.I assume that this is a bad interaction between WebMock, VCR, and google-api-client, but I haven't narrowed it to the smallest case yet (and probably won't now that I have a fix). For reference, here are a few of my related config settings:
I run this in my
RSpec.configure
block in spec_helper:And my VCR setup is (slightly trimmed):
Thanks!