Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: myronmarston/vcr
head fork: myronmarston/vcr
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Mar 10, 2010
@myronmarston Refactored some of the step definitions. 6b7166a
@myronmarston Added asynchronous request replay scenario. This functionality works …
…but I didn't a scenario demonstrating it before.
Commits on Mar 13, 2010
@myronmarston Corrected the wording on a couple of specs. 6b148a0
@myronmarston Fixed a typo and the copyright date. f4eb12f
@myronmarston Updated Readme with links to the CI servers. 4714a00
Commits on Mar 24, 2010
@myronmarston Updated some of the method names/option keys to fit the VCR metaphor …
…better. The first pass of the code was based on "sandboxes" rather than "cassettes" and the terminology reflected that.


* 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
@myronmarston Moved the VCR::Config.default_cassette_record_mode deprecation into t…
…he deprecation file.
@myronmarston Updated readme. 7bdd7ab
Commits on Mar 25, 2010
@myronmarston Fixed deprecation warning message to use the correct method name. ea72321
@myronmarston 0.3.0 release. d4767bf
Commits on Apr 11, 2010
@myronmarston Updated our Net::HTTP extension so that the response is yielded after…
… the response is stored, in case the block has a return statement. Closes GH-1.
@myronmarston 0.3.1 release. 323d72d
@myronmarston Added request body and headers to recorded response. These will come …
…in handy for getting VCR to work with webmock.
@myronmarston Extracted the interactions with FakeWeb into an adapter so we can imp…
…lement the same adapter interface for other http stubbing libraries like WebMock.
@myronmarston Pulled the fakeweb logic that constructs the request_uri out of the n…
…et http extension and put it in the fakeweb extension.
@myronmarston Use the fakeweb http_stubbing_adapter rather than using fakeweb direc…
@myronmarston Updated features rake task to run the features against multiple http_…
@myronmarston Instead of unstubbing the previously stubbed requests, use a checkpoi…
…nt system, so that the http_stubbing registry is returned to exactly the same state.
@myronmarston Removed unneeded fakeweb extensions. 8fe911f
Commits on Apr 15, 2010
@myronmarston Changed the format of the cassettes. Use a VCR structured object rath…
…er than a Net::HTTP response as that is tied directly to net/http and I hope to get this to work with other http libraries eventually.
@myronmarston Added rake task to migrate old VCR cassettes to the new format, to ma…
…ke it easy for VCR users to upgrade.
@myronmarston Migrated all of the vcr cassette fixtures using the rake task. 59acae8
@myronmarston Added back request bodies since I had lost them in the migration. 11bbf3b
@myronmarston Updated the code to work with the new structs and terminology. a835bb5
@myronmarston Implemented the WebMock http stubbing adapter. 208310e
Commits on Apr 16, 2010
@myronmarston Updated the http interaction structs:
- Renamed RequestSignature to Request since the object represents the actual request.
- Changed the response headers to use an array for the values, since a response can have multiple values for the same header.
@myronmarston Updated our cassette fixtures to the latest format. 9a01697
Commits on Apr 17, 2010
@myronmarston Use VCR.http_stubbing_adapter rather than VCR::Config.http_stubbing_a…
@myronmarston Allow the webmock adapter to be used. 011586c
@myronmarston Update the default rake task to that it runs the features with the we…
…bmock adapter in addition to the fakeweb one.
@myronmarston Temporarily disable a spec that won't pass until some changes are mad…
…e to webmock.
@myronmarston Load our net/http extension so it gets used when webmock is used. Whe…
…n fakeweb is used, our net/http extension has to be loaded after it, so we load it after webmock as well.
@myronmarston Simplified our net http extension. 57dec56
@myronmarston Added logic to VCR::Config.http_stubbing_adapter so that it returns t…
…he appropriate value if just one of fakeweb/webmock are loaded.
@myronmarston Raise a helpful error message when people try to use VCR with depreca…
…ted cassettes.
Commits on Apr 18, 2010
@myronmarston Made most of VCR::Cassette's methods private. I had forgotten to make…
… the methods private before, but most of them don't need to be exposed.
@myronmarston Reorganized some code. d17615b
@myronmarston Disallow http connections by default. 5d89dff
@myronmarston Updated exception message to be more helpful. 0242578
@myronmarston Check that the versions of FakeWeb and WebMock are supported. 80ad7b3
@myronmarston Disallow http connections and check the adapter version when the VCR.…
…config block completes, rather than the first time http_stubbing_adpater is accessed. This ensures that these things are done before the test suite starts running.
Commits on Apr 19, 2010
@myronmarston Bumped the webmock version requirement to 1.1.0 as that is the versio…
…n number that will be used for the webmock release that supports VCR.
@myronmarston Override WebMock::NetConnectNotAllowedError so that it includes a hel…
…pful message about using VCR.
Commits on Apr 22, 2010
@myronmarston Added a benchmark to test the performance characterstics of fakeweb v…
…s webmock.
@myronmarston Renamed file. 8d41610
@myronmarston Fixed the vcr task so it actually, you fffd3aa
@myronmarston Change History file to markdown format and renamed it to changelog. 3e442f3
Commits on Apr 24, 2010
@myronmarston Renamed VCR::Cassette#http_stubbing_adapter to http_stubbing_library. 632db1f
@myronmarston Changed the readme to markdown format, and re-wrote most of it. cff2b84
@myronmarston Updated CHANGELOG with the info about what is coming in the next rele…
@myronmarston Updated gemspec info. ee245f3
@myronmarston Updated the cucumber VCR configuration so that it uses :fakeweb by de…
…fault if HTTP_STUBBING_ADAPTER is not set.
Commits on Apr 29, 2010
@myronmarston Use strings instead of symbols for the hash keys for Net::HTTP.post_f…

On my ruby 1.9.1 CI server, the build is failing with this error: "TypeError: can't dup Symbol".  I can't repro this locally (maybe a different 1.9.1 patch level?), but I think this may fix it.
@myronmarston 0.4.0 release. 7663252
Commits on May 12, 2010
@myronmarston Fixed a bug: Net::HTTPResponse#read_body was raising an error because…
… VCR "pre-read" the body when recording a new request.

My fix is to extend the already read response with a module that attempts to preserve the behavior of #read_body when the response has not yet been read.
@myronmarston 0.4.1 release. dfceeb1
Commits on Jun 07, 2010
@myronmarston Removed dependency on jeweler. Manage the gemspec by hand instead. Ex…
…posed the version:

- VCR.version 		=> string (in the format "major.minor.patch")
- => array of integers
- VCR.version.major => integer
- VCR.version.minor => integer
- VCR.version.patch => integer
@myronmarston Use the version in the URL to the README. 6a82f5c
@myronmarston Added cucumber scenario that demonstrates the use of a regex for a UR…
…I in a cassette.
@myronmarston Updated README with info about putting regexes in cassettes. df1e230
Commits on Jun 11, 2010
@myronmarston Remove the Net::ReadAdapter extension. We don't need it now that we r…
…ecord the response before calling the block passed to Net::HTTP#request. Our Net::HTTPResponse extension takes care of making the response act as if it's never been read and works with asynchronous requests properly.
@myronmarston Refactored the http_stubbing_adapter shared spec so that it can be re…
…-used for the different http libraries that webmock supports.
@myronmarston Move the Net::HTTP-specific scenarios and cucumber steps into separat…
…e files, so the main feature/step files can be re-used for multiple http libraries.
@myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
… HTTP library is passed as HTTP_LIB.
Commits on Jun 12, 2010
@myronmarston Moved code out of fakeweb extension and into fakeweb http_stubbing_ad…
@myronmarston Changed the way we allow requests to localhost: rather than having a …
…per-cassette :allow_real_http option, use a #ignore_localhost config setting.

There's no way to make the :allow_real_http option work for the other http libraries.  This is a simpler way to get the important functionality.
Commits on Jun 15, 2010
@myronmarston Fixed warning: "already initialized constant NET_CONNECT_NOT_ALLOWED_…
@myronmarston Work around a bug in WebMock. 1bb664d
@myronmarston Ensure #request_stubbed? works, regardless of if the uri is a string …
…or URI.
@myronmarston Refactored our Net::HTTP recording, and corresponding specs, to make …
…it easier to setup the recording of WebMock's other http libraries, and have them share the same specs.
@myronmarston Remove old deprecations. The next release will be VCR 1.0.0, indicati…
…ng breaking changes.
Commits on Jun 16, 2010
@myronmarston Removed webmock work around that is no longer necessary. 969ac53
@myronmarston Disable FakeWeb::VERSION constant reassignment warnings. 9f08b7a
@myronmarston Hooked up recording of other http libraries, using WebMock.after_requ…
…est callback.
Commits on Jun 17, 2010
@myronmarston Some slight refactoring of our extensions.
WebMock has the same Net::HTTPResponse extension module I have, and to prevent instance variable name collisions, I renamed the instance variable I use.
@myronmarston Updated the fakeweb vs webmock benchmarks using the latest webmock. 2c33d93
Commits on Jun 18, 2010
@myronmarston Added cucumber scenarios to test using HTTPClient asynchronously. 86bc458
@myronmarston Fixed some formatting. fb57340
@myronmarston Generalized a cucumber step so I can easily pass different options to…
… a cassette.
Commits on Jun 19, 2010
@myronmarston Added :erb option that enables dynamic erb cassettes. 2b794ef
@myronmarston Configured rcov rake task. 8f2d6e4
@myronmarston Removed some unused code. bf32f17
@myronmarston Honor default :erb option. e31104e
@myronmarston Raise a more helpful error message when the ERB in a cassette referen…
…ces an undefined variable.
Commits on Jun 21, 2010
@myronmarston Clarified spec name. d102afd
@myronmarston Ensure VCR.http_stubbing_adapter returns the adapter being tested.
I guess this was happening by luck previously (allowing the specs to pass on my box) but the changed order of the specs on the CI server caused it to be a different adapter, causing some failing specs.
@myronmarston Added necessary before/after blocks to prevent WebMock from extending…
… the response with WebMock's version of the same response extension.
@myronmarston Fixed the ignore_localhost option so that localhost requests are neve…
…r recorded when it's set to true.
Commits on Jun 22, 2010
@myronmarston Kill the localserver processes when the test process exits. cac7d2e
@myronmarston Refactored rakefile so that we have features:fakeweb and features:web…
…mock rake tasks.
@myronmarston Our specs that depend on the spawning of a localhost webserver in a s…
…eparate process do not pass on heroku due to their restrictions, so I've disabled them here when the specs are run on heroku.
@myronmarston Fixed the heroku pending module so it passes the pending message to t…
…he pending method.
@myronmarston Disable cucumber scenarios that can't pass on heroku due to heroku's …
@myronmarston Don't set message expectations on nil. 333c394
@myronmarston Add capybara as an explicit development dependency since we use Capyb…
…ara::Server to start a localhost server in some tests.
@myronmarston Ignore error that occurs occassionally when the child process exits i…
…mmediately before #wait is called.
@myronmarston Fixed ignore_localhost so that localhost requests are not registered …
…with the http_stubbing_adapter.
@myronmarston Added spec and feature coverage for em-http-request support. ef1447c
@myronmarston Require webmock 1.3.0. a664c18
@myronmarston Added check_dependencies rake task that is a prerequesite for the spe…
…cs and features.
@myronmarston Relax the cucumber version requirement a bit. 9b7c7c8
@myronmarston Updated benchmarks with latest results. ef8519a
@myronmarston Use #ignore_localhost? rather than #ignore_localhost, since it's more…
… idiomatic ruby.
@myronmarston Gracefully used requirement? or version_requirements? based on which …
…is available. It appears that requirement? isn't available in rubygems 1.3.5.
@myronmarston 1.0.0 release. a5ac5bf
Commits on Jun 26, 2010
@myronmarston Got specs and features to pass on jruby. 50965aa
@myronmarston Improve the speed of some specs: rather than repeating the same HTTP …
…request for each spec, make the HTTP request once, and then clone the response for each spec.
Commits on Jun 27, 2010
@myronmarston The code that stops the localhost server process isn't working on 1.9.2.
Hopefully I can fix it at some point, but for now I'm disabling it and the code that depends on it for 1.9.2.
@myronmarston Got the specs and features to pass on 1.9.2.
Ruby 1.9.1 has some slight YAML serialization differences from 1.8.x.  1.9.2 has the same YAML serialization as 1.8.x, so I've changed the fixtures directories from 1.8.6, 1.8.7 and 1.9.1 to 1.9.1 and not_1.9.1.
@myronmarston Add 1.9.2-preview3 to the list of tested ruby versions. 7bb861c
@myronmarston Fixed localhost server so that it properly shuts down with rack 1.2.1.
I had disabled this for 1.9.2 because I thought it was an issue with that version of ruby, but it was actually an issue with having rack 1.2.1 installed for 1.9.2.  Now I've re-enabled it for 1.9.2.
@myronmarston Ignore rubinius .rbc files. 8e98eac
Commits on Jun 28, 2010
@myronmarston Fixed readme--the :erb setting should be "true" rather than ":true" (…
…a symbol).
Commits on Jun 30, 2010
@myronmarston Added tags to .gitignore. 643c3ce
Commits on Jul 01, 2010
@myronmarston Fixed requires so that each spec file can be run individually. 5243544
@myronmarston Normalize request and response headers so they are always saved with
lower case keys and arrays of values.

This is the way Net::HTTP normalizes them, but recording non-Net::HTTP
requests resulted in cassettes with headers that deviated from this
@myronmarston Fixed VCR.use_cassette so that it only ejects the cassette if it was …
…successfully inserted.
@myronmarston Added spec for basic auth for #request_uri on the http stubbing
@ericallam ericallam Fixed an undefined constant FakeWeb::Utility error 0638040
@myronmarston Fixed spec description. 5226f81
@myronmarston Reorganized specs so that they are grouped more logically. 4b8f6dc
Commits on Jul 02, 2010
@myronmarston Updated README. e9c7e31
@myronmarston 1.0.1 release. ade8181
Commits on Jul 04, 2010
@myronmarston Use the --debugger option rather than starting the debugger manually. 30f5c5d
Commits on Jul 05, 2010
@myronmarston Use bundler to manage gem dependencies. bca4e49
Commits on Jul 06, 2010
@myronmarston Silence WEBrick logging. 5c29c88
@myronmarston Disable the --debugger option for jruby since ruby-debug can't be ins…
…talled on jruby.
@myronmarston The current version of rack (1.2.1) does not work on ruby 1.8.6, so l…
…ock the dependency to 1.2.0.
@myronmarston Ensure the response body is serialized as a raw string, without any e…
…xtensions on the string instance.

This is needed for rest-client.  Closes #4.
@myronmarston Add conditional check so we don't get an exception for a nil body. 1678b3f
@myronmarston Removed check_dependencies rake task. It's no longer necessary with b…
@myronmarston 1.0.2 release. e13d215
Commits on Jul 22, 2010
@myronmarston Use the platform feature of bundler rather than conditional checks.
Commit the Gemfile.lock file to lock us to this set of gems.
@myronmarston Lock cucumber to 0.8.5 or greater. Added rake as a development depend…
…ency since I use it for development.
@myronmarston Added a be_tagged_with matcher since cucumber no longer provides the …
…#tagged_with? method.
@myronmarston Lock to em-http-request 0.2.7.
The newest release (0.2.10) doesn't work with webmock--see for more info.
Commits on Jul 27, 2010
@myronmarston Upgrade to rspec-2. f05cc59
Commits on Aug 01, 2010
@myronmarston Added spec focused filtering. 817c2b9
@myronmarston Use cucumber Around hook rather than Before/After hooks, as it simpli…
…fies the code significantly.
@myronmarston Simplify passing the block to VCR.use_cassette -- use &block rather t…
…han { }.
Commits on Aug 04, 2010
@myronmarston Require WebMock 1.3.3 or greater.
Previous versions did not handle multiple values for the same response header correctly.  Note that FakeWeb has this issue, too, and I've submitted a patch to fix it.

This closes issue #7.
Commits on Aug 06, 2010
@myronmarston Added link to the new google group. f68da93
@myronmarston Updated README section about WebMock and FakeWeb. 3e69767
@myronmarston Updated VCR usage suggestions. dd5c563
@myronmarston Added note about other similar libraries to the README. f410fda
@myronmarston Updated README to mention RSpec 2 usage. 5aa47b2
@myronmarston 1.0.3 release. ce13279
Commits on Aug 07, 2010
@myronmarston Updated Gemfile.lock. 3bcafd9
@myronmarston Removed task runner as it's no longer needed. 0289298
@myronmarston Raise an error if is given invalid options. 606e328
@myronmarston Optimized ERB rendering a bit. f2bb986
@myronmarston Updated em-http-request to 0.2.10.
See for more info about some of the changes.
Commits on Aug 09, 2010
@myronmarston Extracted the http calls from the specs for each http library into mo…
…dules that we can use in our cucumber features to keep things DRY.
@myronmarston Updated URLs in our cucumber scenarios to be full URLs.
URI.parse('') raises an error because it lacks a path.
URI.parse('') does not ('/' is the path).
Commits on Aug 10, 2010
@myronmarston Ignore .bundle dir. 043a05b
Commits on Aug 11, 2010
@myronmarston Simplify Net::HTTP extension a bit. 788590f
Commits on Aug 12, 2010
@myronmarston Enable debugger in specs. 3ced987
@myronmarston Added some failing scenarios for the new :match_requests_on feature I…
…'m working on.
@myronmarston Added RequestMatcher, which we'll use to determine which parts of an …
…HTTP request to match on.
@myronmarston Added VCR::Request#matcher, which returns a request matcher for the g…
…iven request, using the provided match_attributes.
Commits on Aug 16, 2010
@myronmarston Changed the HTTP Stubbing Adapters to support the match_requests_on
@myronmarston Documentation updates for new :match_requests_on option. 3def0be
Commits on Aug 17, 2010
@myronmarston Minor documentation tweaks. b1c62bc
@bblimke bblimke Added failing spec to show a problem with recording request headers b…
…efore the real request is made.
@myronmarston Do not record Net::HTTP request headers that it defaults late in the …
…http request process.

Closes #10.
@myronmarston Simplified implementation of RequestMatcher#hash. b470034
@myronmarston Fixed RequestMatcher to handle regex URIs. 2a66bb0
Commits on Aug 18, 2010
@myronmarston Updated README to recommend putting the vcr cassette library director…
…y outside of test/fixtures for a Rails 3 app.

This closes #9.
Commits on Aug 19, 2010
@myronmarston Updated Gemfile to use rspec-core off of github since I'm using some …
…features that haven't been released in a gem yet.
@myronmarston Disable rspec debug for java since ruby-debug doesn't install cleanly…
… on jruby with bundler.
@myronmarston Updated http_stubbing_adapter.request_stubbed? so that it uses a Requ…
Commits on Aug 20, 2010
@myronmarston Refactored some tests. 0f304c1
@myronmarston Fixed some host specs to include a path. bb479ce
Commits on Aug 21, 2010
@myronmarston Add support for matching requests on :path. 0f9165e
@myronmarston Use the latest rspec-expectations from github since it includes a 1.8…
….6 compatibility fix that hasn't been released yet.
Commits on Aug 22, 2010
@myronmarston Fix specs so they pass on 1.8.6. 69d060f
@myronmarston 1.9.2 compatibility fix: sort attributes before putting them in a Set.
On 1.9.2,[1, 2]).hash !=[2, 1]).hash, but[1, 2]).hash ==[1, 2]).hash.
@myronmarston 1.9.2 compatibility fix: don't try to use ruby-debug on 1.9.2.
On 1.9.2, I'm getting errors like these:

dyld: lazy symbol binding failed: Symbol not found: _rb_method_node
  Referenced from: /Users/mmarston/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-base19-0.11.23/lib/ruby_debug.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_method_node
  Referenced from: /Users/mmarston/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-base19-0.11.23/lib/ruby_debug.bundle
  Expected in: flat namespace
@myronmarston 1.9.2 compatibility fix: in an override, use an alias to refer to the…
… original method rather than super.

This works around an error I'm getting on 1.9.2:

"super from singleton method that is defined to multiple classes is not supported; this will be fixed in 1.9.3 or later"
@myronmarston Make it easy to temporarily use documentation format for the specs. 4ed657f
@myronmarston 1.9.1 compatibility fix: moved a constant to the global namespace to …
…avoid an rspec bug that manifests on 1.9.1.

See these links for more info:
@myronmarston Lock rspec-core to one of my branches that fixes an issue with shared…
… example groups on 1.8.6.
@myronmarston Require spec_helper's full expanded path so it's not loaded twice. 9fbae9f
@myronmarston Fixed Gemfile so rbx can use it. rcov doesn't work on rbx. 1c49c08
@myronmarston Readme updates. c948f88
@myronmarston 1.1.0 release. 4a465ca