vcr v2.2.0 Release Notes

Release Date: 2012-05-31 // over 10 years ago
  • Full Changelog

    ✨ Enhancements:

    • Add new :persist_with cassette option. It allows you to provide a customized persistence implementation so you can persist it to something other than disk (i.e. a key-value store or a database). Thanks to Chris Le for the idea and help with the implementation.
    • Allow requests to be stubbed by external libraries (e.g. WebMock, FakeWeb or Typhoeus) without needing to turn VCR off.
    • Add new :allow_unused_http_interactions cassette option. When set to false, an error will be raised when a cassette is ejected and there are remaining unused HTTP interactions. Thanks to Mattias Putman for the idea and initial implementation.

    🐛 Bug Fixes:

    • Fix after_http_request to handle symbol request predicate filters (e.g. :ignored?, :stubbed?, :recordable?, :unhandled?, :real?) properly. Previously using one of these would raise an ArgumentError. Thanks to playupchris for reporting the bug and providing a fix.
    • Fix FakeWeb hook so that it no longer breaks FakeWeb.allow_net_connect? with arguments. Thanks to Ingemar for reporting the bug and providing a fix.
    • Fix WebMock hook so that it no longer breaks WebMock.net_connect_allowed? with arguments. Thanks to Gordon Wilson for reporting the bug and providing a fix.
    • Print a warning when VCR is used with a poorly behaved Faraday connection stack that has a middleware after the HTTP adapter. VCR may work improperly in this case.
    • Raise an error if a response object is recorded with a non-string body. This fails early and indicates the problem rather than failing later with a strange error.
    • Fix filter_sensitive_data/define_cassette_placeholder so that they handle non-strings gracefully (e.g. the port number as a Fixnum).
    • Gracefully handle Faraday connection stacks that do not explicitly specify an HTTP adapter. Thanks to Patrick Roby for reporting the bug.
    • Work around a bug in WebMock's em-http-request adapter that prevented VCR from working when using the :redirects option with em-http-request. This change is just a work around. It fixes the main problem, but some features (such as the http request hooks) may not work properly for this case. The bug will ultimately need to be fixed in WebMock. Thanks to Mark Abramov for reporting the bug and providing a great example test case.
    • Fix bug in handling of Faraday requests with multipart uploads. Thanks to Tyler Hunt for reporting and fixing the bug.