Skip to content

HTTPS clone URL

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.
d7eb41e
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.

Changes:

* 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
5f4089f
@myronmarston Moved the VCR::Config.default_cassette_record_mode deprecation into t…
…he deprecation file.
3545053
@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.
fe4fa1c
@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.
7003176
@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.
024fab9
@myronmarston Pulled the fakeweb logic that constructs the request_uri out of the n…
…et http extension and put it in the fakeweb extension.
91e944d
@myronmarston Use the fakeweb http_stubbing_adapter rather than using fakeweb direc…
…tly.
ddbfa8c
@myronmarston Updated features rake task to run the features against multiple http_…
…stubbing_adapters.
973481f
@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.
674bfde
@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.
9b230ba
@myronmarston Added rake task to migrate old VCR cassettes to the new format, to ma…
…ke it easy for VCR users to upgrade.
b582340
@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.
39fb46d
@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…
…dapter.
62eb574
@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.
bb84b1a
@myronmarston Temporarily disable a spec that won't pass until some changes are mad…
…e to webmock.
d5f3a69
@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.
8cd5049
@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.
b8d942d
@myronmarston Raise a helpful error message when people try to use VCR with depreca…
…ted cassettes.
4128bcc
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.
4ff3f9b
@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.
dede4db
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.
55564f7
@myronmarston Override WebMock::NetConnectNotAllowedError so that it includes a hel…
…pful message about using VCR.
37bac90
Commits on Apr 22, 2010
@myronmarston Added a benchmark to test the performance characterstics of fakeweb v…
…s webmock.
aa775a3
@myronmarston Renamed file. 8d41610
@myronmarston Fixed the vcr task so it actually, you know....works. 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…
…ase.
af61cfc
@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.
892ba38
Commits on Apr 29, 2010
@myronmarston Use strings instead of symbols for the hash keys for Net::HTTP.post_f…
…orm.

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.
8e4121e
@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.
4b5647a
@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")
- VCR.version.parts => array of integers
- VCR.version.major => integer
- VCR.version.minor => integer
- VCR.version.patch => integer
dd461d5
@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.
44846a8
@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.
d3cfe2a
@myronmarston Refactored the http_stubbing_adapter shared spec so that it can be re…
…-used for the different http libraries that webmock supports.
e214094
@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.
de5f325
@myronmarston Refactor the vcr steps so they are polymorphic, and can use whichever…
… HTTP library is passed as HTTP_LIB.
b1926ca
Commits on Jun 12, 2010
@myronmarston Moved code out of fakeweb extension and into fakeweb http_stubbing_ad…
…apter.
f9102cf
@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.
516d775
Commits on Jun 15, 2010
@myronmarston Fixed warning: "already initialized constant NET_CONNECT_NOT_ALLOWED_…
…ERROR".
6b54846
@myronmarston Work around a bug in WebMock. 1bb664d
@myronmarston Ensure #request_stubbed? works, regardless of if the uri is a string …
…or URI.
c6d4a06
@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.
e405e60
@myronmarston Remove old deprecations. The next release will be VCR 1.0.0, indicati…
…ng breaking changes.
2c7983f
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.
97679f4
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.
f8ccbd6
@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.
7a21d6b
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.
0df2c97
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.
1d61fb8
@myronmarston Added necessary before/after blocks to prevent WebMock from extending…
… the response with WebMock's version of the same response extension.
d277b8b
@myronmarston Fixed the ignore_localhost option so that localhost requests are neve…
…r recorded when it's set to true.
4cdcfe3
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.
05bbce0
@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.
f09b789
@myronmarston Fixed the heroku pending module so it passes the pending message to t…
…he pending method.
3838dc1
@myronmarston Disable cucumber scenarios that can't pass on heroku due to heroku's …
…restrictions.
acc398b
@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.
a90cf98
@myronmarston Ignore error that occurs occassionally when the child process exits i…
…mmediately before #wait is called.
91c8158
@myronmarston Fixed ignore_localhost so that localhost requests are not registered …
…with the http_stubbing_adapter.
632f256
@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.
a5054b7
@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.
29925bc
@myronmarston Gracefully used requirement? or version_requirements? based on which …
…is available. It appears that requirement? isn't available in rubygems 1.3.5.
a3d3cb5
@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.
d038048
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.
ba815a7
@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.
f2224df
@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.
837e6df
@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).
7add332
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
norm.
fe2c253
@myronmarston Fixed VCR.use_cassette so that it only ejects the cassette if it was …
…successfully inserted.
34a160c
@myronmarston Added spec for basic auth for #request_uri on the http stubbing
adapters.
1fc4e26
@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.
688adc5
@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.
ded657b
@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.
db348c3
@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…
…undler.
a01d539
@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.
8ea7293
@myronmarston Lock cucumber to 0.8.5 or greater. Added rake as a development depend…
…ency since I use it for development.
d198b33
@myronmarston Added a be_tagged_with matcher since cucumber no longer provides the …
…#tagged_with? method.
dd49c9d
@myronmarston Lock to em-http-request 0.2.7.
The newest release (0.2.10) doesn't work with webmock--see http://github.com/bblimke/webmock/issues/issue/29 for more info.
afaf807
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.
325a275
@myronmarston Simplify passing the block to VCR.use_cassette -- use &block rather t…
…han { block.call }.
aa00162
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.
2884c18
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 VCR::Cassette.new is given invalid options. 606e328
@myronmarston Optimized ERB rendering a bit. f2bb986
@myronmarston Updated em-http-request to 0.2.10.
See http://github.com/igrigorik/em-http-request/issues/42 for more info about some of the changes.
a40025f
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.
49bf733
@myronmarston Updated URLs in our cucumber scenarios to be full URLs.
URI.parse('http://example.com') raises an error because it lacks a path.
URI.parse('http://example.com/') does not ('/' is the path).
263c4f8
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.
9a98992
@myronmarston Added RequestMatcher, which we'll use to determine which parts of an …
…HTTP request to match on.
0513480
@myronmarston Added VCR::Request#matcher, which returns a request matcher for the g…
…iven request, using the provided match_attributes.
f31f771
Commits on Aug 16, 2010
@myronmarston Changed the HTTP Stubbing Adapters to support the match_requests_on
option.
251c100
@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.
3333a0d
@myronmarston Do not record Net::HTTP request headers that it defaults late in the …
…http request process.

Closes #10.
d8ae754
@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.
7a1d682
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.
8f15c01
@myronmarston Disable rspec debug for java since ruby-debug doesn't install cleanly…
… on jruby with bundler.
19d48b4
@myronmarston Updated http_stubbing_adapter.request_stubbed? so that it uses a Requ…
…estMatcher.
3d2dce7
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.
391f5c9
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, Set.new([1, 2]).hash != Set.new([2, 1]).hash, but Set.new([1, 2]).hash == Set.new([1, 2]).hash.
1e1422e
@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
81957d2
@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"
5c0d3eb
@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:
- http://github.com/rspec/rspec-core/issues#issue/41/comment/365562
- http://gist.github.com/543381
95890dd
@myronmarston Lock rspec-core to one of my branches that fixes an issue with shared…
… example groups on 1.8.6.
f2185eb
@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