Closed soffes closed 9 years ago
:green_apple:
Hey @soffes, I guess that's fine you closed #5, I'm still not a big fan of breaking/having to migrate old cassettes, that's why I kept that extra key in the request/response dictionary so that DVR always knows how to deserialize it. I guess this is more forward-looking, after we somehow migrate old cassettes (have you created the script to migrate them btw?).
Anyway, you also missed out on a bunch of tests in #5 - those are independent on your/mine implementation, but basically test that all this code you wrote works. I suggest you copy/paste them if you want, because they test all the serialization cases.
This is a simpler implementation of #5. Not sure that it's better though. If we decide we want to merge this, then I'll write a Ruby script to convert old cassettes to the new format.
If the content type begins with
text/
it is included as a string in the JSON encoding of the cassette. If they content type isapplication/json
, the object is included as a nested array or dictionary in the JSON. If it's anything else, we'll continue to base64 encode it (for stuff like images, etc).This also adds a new line to the end of cassettes :)