Skip to content

Latest commit

 

History

History
386 lines (284 loc) · 19.3 KB

CHANGELOG.md

File metadata and controls

386 lines (284 loc) · 19.3 KB

In git

Full Changelog

  • Fix header normalization so that it properly handles nested arrays and non-string values.
  • Add cucumber scenario documenting how VCR sanitizes cassette names to "normal" file names (i.e. only alphanumerics, no spaces).
  • Add :ignore_cassettes option to VCR.turn_off!. This causes cassette insertions to be ignored rather than to trigger an error.

1.9.0 (April 14, 2011)

Full Changelog

1.8.0 (March 31, 2011)

Full Changelog

  • Updated Faraday middleware to work with newly released Faraday 0.6.0.

1.7.2 (March 26, 2011)

Full Changelog

  • Fixed Typhoeus adapter so headers are returned in the same form during playback as they would be without VCR. Bug reported by Avdi Grimm.
  • Fixed Faraday adapter so it treats response headers in the same way Faraday itself does (i.e. with lowercase keys).

1.7.1 (March 19, 2011)

Full Changelog

  • Fix Faraday adapter so that it properly normalizes query parameters in the same way that Faraday itself does.

1.7.0 (March 1, 2011)

Full Changelog

  • Use Psych for YAML serialization/deserialization when it is available. Syck, Ruby's old YAML engine, will remove whitespace from some strings. Bug reported by Robert Poor.
  • Add new :update_content_length_header cassette option. The option will ensure the content-length header value matches the actual response body length.
  • Add new :once record mode. It operates like :new_episodes except when the cassette file already exists, in which case it causes new requests to raise an error. Feature suggested by Jamie Cobbett.
  • Made :once the default record mode.
  • Add new filter_sensitive_data configuration option. Feature suggested by Nathaniel Bibler.
  • Commit to Semantic Versioning. The cucumber features document the public API for the purposes of semver.
  • Add support for CI builds using travis-ci.
  • Add support for running tests through gem test vcr. Visit test.rubygems.org to see the results.
  • Fix cucumber support to use separate Before & After hooks rather than a single Around hook because of a bug in cucumber that prevents background steps from running within the Around hook.

1.6.0 (February 3, 2011)

Full Changelog

  • Add new ignore_hosts configuration option that allows you to ignore any host (not just localhost aliases, as the ignore_localhost option works). Feature suggested by Claudio Poli.
  • Upgraded to the latest Typhoeus (0.2.1).
  • General code clean up and refactoring.

1.5.1 (January 12, 2011)

Full Changelog

  • Fix response and request serialization so that the headers are raw strings. This fixes intermittent YAML seg faults for paperclip uploads to S3. Bug reported by Rob Slifka.

1.5.0 (January 12, 2011)

Full Changelog

  • Fix VCR::Cassette so it does not raise an error when a cassette file is empty. Bug reported and fixed by Karl Baum.
  • Lots of code cleanup.
  • Fix the stubbing adapters so that they use the cassette instance rather than the cassette name to create and restore checkpoints.
  • Raise an appropriate error when a nested cassette is inserted with the same name as a cassette that is already in the stack (VCR's design doesn't allow this and you would get weird errors later on).
  • Raise an appropriate error when restoring a stubs checkpoint if the checkpoint cannot be found.
  • Add before_record and before_playback hooks. Idea and initial implementation by Oliver Searle-Barnes; futher suggestions, testing and feedback by Nathaniel Bibler.

1.4.0 (December 3, 2010)

Full Changelog

  • Added support for making HTTP requests without a cassette (i.e. if you don't want to use VCR for all of your test suite). There are a few ways to enable this:
    • In your VCR.config block, set allow_http_connections_when_no_cassette to true to allow HTTP requests without a cassette.
    • You can temporarily turn off VCR using VCR.turned_off { ... }.
    • You can toggle VCR off and on with VCR.turn_off! and VCR.turn_on!.
  • Fixed bug with ignore_localhost config option. Previously, an error would be raised if it was set before the stub_with option.
  • Added VCR::Middleware::Rack (see features/middleware/rack.feature for usage).
  • Added support for Faraday (see features/middleware/faraday.feature for usage).

1.3.3 (November 21, 2010)

Full Changelog

  • In specs, hit a local sinatra server rather than example.com. This makes the specs faster and removes an external dependency. The specs can pass without being online!
  • Raise an explicit error when the http stubbing library is not configured (rather than letting the user get a confusing error later).
  • Test against the latest WebMock release (1.6.1) (no changes required).
  • Fix a few cucumber scenarios so they pass on rubinius and jruby.

1.3.2 (November 16, 2010)

Full Changelog

  • Fix serialized structs so that they are normalized andthey will be the same regardless of which HTTP library made the request.
    • Status "OK " => "OK"
    • Body '' => nil
    • Headers {} => nil
    • Remove extraneous headers added by the HTTP lib (i.e. Typhoeus user agent)
  • Rewrite cucumber features in a more documentation-oriented style.

1.3.1 (November 11, 2010)

Full Changelog

  • Update WebMock adapter to work with (and require) newly released WebMock 1.6.0.

1.3.0 (November 11, 2010)

Full Changelog

  • Moved documentation from README to Wiki.
  • Refactoring and code cleanup.
  • Fix InternetConnection.available? so that it memoizes correctly when a connection is not available.
  • Fix WebMock version checking to allow newly released 1.5.0 to be used without a warning.
  • Add support for Typhoeus. Thanks to David Balatero for making the necessary changes in Typhoeus to support VCR.
  • Remove FakeWeb/WebMock inference logic. You must configure the http stubbing library explicitly now.

1.2.0 (October 13, 2010)

Full Changelog

  • Improved the :all record mode so that it keeps previously recorded interactions that do not match the new recorded interactions. Previously, all of the previously recorded interactions were deleted.
  • Added :re_record_interval cassette option. This option causes a cassette to be re-recorded when the existing file is older than the specified interval.
  • Improved RSpec support. Added #use_vcr_cassette RSpec macro method that sets up a cassette for an RSpec example group.
  • Fixed VCR/Net::HTTP/WebMock integration so that VCR no longer loads its Net::HTTP monkey patch when WebMock is used, and relies upon WebMock's after_request callback to record Net::HTTP instead. This fixes a bug when using WebMock and Open URI.
  • Consider 0.0.0.0 to be a localhost alias (previously only "localhost" and 127.0.0.1 were considered).
  • Added spec and feature coverage for Curb integration. Works out of the box with no changes required to VCR due to Pete Higgins' great work to add Curb support to WebMock.
  • Got specs and features to pass on rubinius.
  • Changed WebMock version requirement to 1.4.0.

1.1.2 (September 9, 2010)

Full Changelog

  • Fixed a minor bug with the WebMock integration: WebMock extends each Net::HTTPResponse with an extension module after reading the body, and VCR was doing the same thing, leading to some slight deviance from standard Net::HTTP behavior. The fix prevents VCR from adding the same extension to a Net::HTTPResponse that has already been extende by WebMock.
  • Fixed a minor bug in the VCR::Net::HTTPResponse module so that it correctly handles nil bodies (such as for a HEAD request).
  • Refactored VCR::Net::HTTPResponse module so it is implemented in a much simpler manner.
  • Updated specs and features so they pass against the latest WebMock release (1.3.5).
  • Minor documentation updates.

1.1.1 (August 26, 2010)

Full Changelog

  • Updated to use and require FakeWeb 1.3.0. It includes a fix for a bug related to multiple values for the same response header.
  • Use new FakeWeb::Utility.request_uri_as_string method rather than our own logic to construct a request uri.
  • Use new FakeWeb.allow_net_connect = /url regex/ feature to power the ignore_localhost VCR option rather then toggling FakeWeb.allow_net_connect in our Net::HTTP extension.
  • Optimized VCR.http_stubbing_adapter.stub_requests a bit.
  • Changed the http stubbing adapters to be modules rather than classes. They should never be instantiated and don't really hold state, so a module is more appropriate.
  • Warn when FakeWeb or WebMock are a minor or major version number ahead of the required version, as the new version isn't known to work with VCR.

1.1.0 (August 22, 2010)

Full Changelog

  • Added :match_requests_on cassette option, which determines how VCR matches requests.
  • Removed VCR::TaskRunner and the corresponding rake task definition. The rake task migrated cassettes from the 0.3.1 format to the 0.4+ format. If you are still on 0.3.1 or earlier, I recommend you upgrade to 0.4.1 first, migrate your cassettes and deal with migration warnings, then upgrade to the current release.
  • Added some code to VCR::Cassette.new to check the options passed to the cassette and raise an error if any invalid options are passed.
  • Optimized ERB rendering a bit. Rather than creating a new struct subclass for each time we render an ERB cassette with locals, we keep a cache of reusable struct subclasses based on the desired attributes. Benchmarking reveals this is about 28% faster.
  • Upgraded tests to use em-http-request 0.2.10 rather than 0.2.7.

1.0.3 (August 5, 2010)

Full Changelog

  • Upgraded VCR specs to RSpec 2.
  • Updated VCR::CucumberTags so that it uses an around hook rather than a before hook and an after hook. Around hooks were added to Cucumber in the 0.7.3 release, so you'll have to be on that version or higher to use the VCR::CucumberTags feature.
  • Updated the WebMock version requirement to 1.3.3 or greater. 1.3.2 and earlier versions did not properly handle multiple value for the same response header.
  • Miscellaneous documentation updates.

1.0.2 (July 6, 2010)

Full Changelog

  • Fixed VCR to work with rest-client. Rest-client extends the Net::HTTP response body string with a module containing additional data, which got serialized to the cassette file YAML and occasionally caused problems when the YAML was deserialized. Bug reported by Thibaud Guillaume-Gentil.
  • Setup bundler to manage development dependencies.

1.0.1 (July 1, 2010)

Full Changelog

  • Fixed specs and features so they pass on MRI 1.9.2-preview3 and JRuby 1.5.1.
  • Normalized response and request headers so that they are stored the same (i.e. lower case keys, arrays of values) in the cassette yaml files, regardless of which HTTP library is used. This is the same way Net::HTTP normalizes HTTP headers.
  • Fixed VCR.use_cassette so that it doesn't eject a cassette if an exception occurs while inserting one.
  • Fixed FakeWeb adapter so that it works for requests that use basic auth. Patch submitted by Eric Allam.

1.0.0 (June 22, 2010)

Full Changelog

  • New Features

    • Added support for HTTPClient, Patron and em-http-request when WebMock is used. Any future http libraries WebMock supports should (theoretically, at least) work without any VCR code changes. Thanks to Bartosz Blimke for adding the necessary code to WebMock to make this happen!
    • Added support for dynamic responses using ERB. A cassette will be evaluated as ERB before the YAML is deserialized if you pass it an :erb => true option. You can pass variables using :erb => { :var1 => 'some value', :var2 => 'another value' }.
    • Added ignore_localhost configuration setting, which defaults to false. Setting it true does the following:
      • Localhost requests will proceed as normal. The "Real HTTP connections are disabled" error will not occur.
      • Localhost requests will not be recorded.
      • Previously recorded localhost requests will not be replayed.
    • Exposed the version number:
      • VCR.version => string (in the format "major.minor.patch")
      • VCR.version.parts => array of integers
      • VCR.version.major => integer
      • VCR.version.minor => integer
      • VCR.version.patch => integer
    • Added test coverage and documentation of using a regex for non-deterministic URLs (i.e. URLs that include a timestamp as a query parameter). It turns out this feature worked before, and I just didn't realize it :).
  • Breaking Changes

    • The :allow_real_http => lambda { |uri| ... } cassette option has been removed. There was no way to get this to work with the newly supported http libraries without extensive monkeypatching, and it was mostly useful for localhost requests, which is more easily handled by the new ignore_localhost config setting.
    • Removed methods and options that had been previously deprecated. If you're upgrading from an old version, I recommend upgrading to 0.4.1 first, deal with all the deprecation warnings, then upgrade to 1.0.0.
  • Misc Changes:

    • Removed dependency on jeweler. Manage the gemspec by hand instead.
    • Removed some extensions that are no longer necessary.

0.4.1 May 11, 2010

Full Changelog

  • Fixed a bug: when Net::HTTPResponse#read_body was called after VCR had read the body to record a new request, it raised an error (IOError: Net::HTTPResponse#read_body called twice). My fix extends Net::HTTPResponse so that it no longer raises this error.

0.4.0 April 28, 2010

Full Changelog

  • Added support for webmock. All the fakeweb-specific code is now in an adapter (as is the webmock code).

  • Changed the format of the VCR cassettes. The old format was tied directly to Net::HTTP, but webmock supports other HTTP libraries and I plan to allow VCR to use them in the future. Note that this is a breaking change--your old VCR cassettes from prior releases will not work with VCR 0.4.0. However, VCR provides a rake task to assist you in migrating your cassettes to the new format. Simply add load 'vcr/tasks/vcr.rake' to your project's Rakefile, and run:

    $ rake vcr:migrate_cassettes DIR=path/to/cassete/library/directory

  • The new cassette format records more information about the request (i.e. the request headers and body), so that it can potentially be used with webmock in the future.

  • Made most of VCR::Cassette's methods private. I had forgotten to make the methods private before, and most of them don't need to be exposed.

  • Automatically disallow http connections using the appropriate setting of the http stubbing library (fakeweb or webmock). This relieves users from the need to set the option themselves, so they hopefully aren't using either fakeweb or webmock directly, making it much easier to switch between these.

  • Change documentation from rdoc to markdown format.

  • Lots of other refactoring.

0.3.1 April 10, 2010

Full Changelog

  • Fixed a bug: when Net::HTTP#request was called with a block that had a return statement, the response was not being recorded.

0.3.0 March 24, 2010

Full Changelog

  • Renamed a bunch of methods, replacing them with method names that more clearly fit the VCR/cassette metaphor:

    • VCR.create_cassette! => VCR.insert_cassette
    • VCR.destroy_cassette! => VCR.eject_cassette
    • VCR.with_cassette => VCR.use_cassette
    • VCR::Cassette#destroy! => VCR::Cassette#eject
    • VCR::Cassette#cache_file => VCR::Cassette#file
    • VCR::Config.cache_dir => VCR::Config.cassette_library_dir
    • :unregistered record mode => :new_episodes record mode
  • All the old methods still work, but you'll get deprecation warnings.

0.2.0 March 9, 2010

Full Changelog

  • Added :allow_real_http cassette option, which allows VCR to work with capybara and a javascript driver. Bug reported by Ben Hutton.

  • Deprecated the default_cassette_record_mode option. Use default_cassette_options[:record_mode] instead.

0.1.2 March 4, 2010

Full Changelog

  • Added explanatory note about VCR to FakeWeb::NetConnectNotAllowedError#message.

  • Got things to work for when a cassette records multiple requests made to the same URL with the same HTTP verb, but different responses. We have to register an array of responses with fakeweb.

  • Fixed our Net::HTTP monkey patch so that it only stores the recorded response once per request. Internally, Net::HTTP#request recursively calls itself (passing slightly different arguments) in certain circumstances.

0.1.1 February 25, 2010

Full Changelog

0.1.0 February 25, 2010

Full Changelog

  • Initial release. Basic recording and replaying of responses works.