vcr 2.9.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/about_these_examples.md +1 -1
- data/features/cassettes/automatic_re_recording.feature +4 -4
- data/features/cassettes/decompress.feature +3 -3
- data/features/cassettes/exclusive.feature +11 -8
- data/features/cassettes/format.feature +135 -32
- data/features/cassettes/naming.feature +2 -2
- data/features/cassettes/no_cassette.feature +4 -4
- data/features/configuration/allow_http_connections_when_no_cassette.feature +6 -3
- data/features/configuration/cassette_library_dir.feature +2 -2
- data/features/configuration/debug_logging.feature +15 -8
- data/features/configuration/filter_sensitive_data.feature +8 -7
- data/features/configuration/hook_into.feature +8 -8
- data/features/configuration/ignore_request.feature +13 -14
- data/features/configuration/preserve_exact_body_bytes.feature +5 -5
- data/features/configuration/uri_parser.feature +15 -11
- data/features/hooks/after_http_request.feature +5 -4
- data/features/hooks/around_http_request.feature +3 -3
- data/features/hooks/before_http_request.feature +4 -2
- data/features/hooks/before_playback.feature +14 -15
- data/features/hooks/before_record.feature +10 -10
- data/features/http_libraries/em_http_request.feature +6 -3
- data/features/http_libraries/net_http.feature +15 -5
- data/features/middleware/faraday.feature +2 -2
- data/features/middleware/rack.feature +4 -4
- data/features/record_modes/all.feature +5 -5
- data/features/record_modes/new_episodes.feature +2 -2
- data/features/record_modes/once.feature +3 -3
- data/features/step_definitions/cli_steps.rb +37 -39
- data/features/support/env.rb +29 -26
- data/features/support/http_lib_filters.rb +0 -7
- data/features/test_frameworks/cucumber.feature +11 -10
- data/features/test_frameworks/rspec_macro.feature +5 -30
- data/features/test_frameworks/rspec_metadata.feature +9 -8
- data/features/test_frameworks/test_unit.feature +5 -2
- data/lib/vcr.rb +86 -14
- data/lib/vcr/cassette.rb +4 -2
- data/lib/vcr/cassette/serializers.rb +10 -8
- data/lib/vcr/cassette/serializers/compressed.rb +45 -0
- data/lib/vcr/configuration.rb +38 -17
- data/lib/vcr/library_hooks/fakeweb.rb +1 -0
- data/lib/vcr/library_hooks/faraday.rb +5 -1
- data/lib/vcr/middleware/faraday.rb +13 -9
- data/lib/vcr/test_frameworks/cucumber.rb +39 -5
- data/lib/vcr/version.rb +1 -1
- data/spec/acceptance/concurrency_spec.rb +51 -0
- data/spec/{vcr → lib/vcr}/cassette/erb_renderer_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/http_interaction_list_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/migrator_spec.rb +10 -9
- data/spec/{vcr → lib/vcr}/cassette/persisters/file_system_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/persisters_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/cassette/serializers_spec.rb +8 -2
- data/spec/{vcr → lib/vcr}/cassette_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/configuration_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/deprecations_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/errors_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/extensions/net_http_response_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/excon_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/fakeweb_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/faraday_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/typhoeus_0.4_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/typhoeus_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/library_hooks/webmock_spec.rb +2 -2
- data/spec/{vcr → lib/vcr}/library_hooks_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/middleware/faraday_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/middleware/rack_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/request_ignorer_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/request_matcher_registry_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/structs_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/test_frameworks/cucumber_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/test_frameworks/rspec_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/hooks_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/internet_connection_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/util/version_checker_spec.rb +0 -0
- data/spec/{vcr → lib/vcr}/version_spec.rb +0 -0
- data/spec/{vcr_spec.rb → lib/vcr_spec.rb} +2 -2
- data/spec/spec_helper.rb +21 -50
- data/spec/support/cucumber_helpers.rb +39 -0
- data/spec/support/limited_uri.rb +1 -11
- data/spec/support/shared_example_groups/hook_into_http_library.rb +2 -1
- data/spec/support/vcr_localhost_server.rb +2 -3
- metadata +475 -123
- data/.gemtest +0 -0
- data/.gitignore +0 -52
- data/.gitmodules +0 -3
- data/.rspec +0 -2
- data/.travis.yml +0 -27
- data/.yardopts +0 -9
- data/Appraisals +0 -5
- data/CHANGELOG.md +0 -987
- data/CONTRIBUTING.md +0 -26
- data/Gemfile +0 -54
- data/Gemfile.lock +0 -159
- data/LICENSE +0 -20
- data/README.md +0 -243
- data/Rakefile +0 -197
- data/Upgrade.md +0 -289
- data/benchmarks/http_stubbing_libraries.rb +0 -59
- data/benchmarks/null_logging.rb +0 -62
- data/cucumber.yml +0 -16
- data/features/.nav +0 -62
- data/features/cassettes/persistence.feature +0 -63
- data/features/support/vcr_cucumber_helpers.rb +0 -46
- data/gemfiles/typhoeus_old.gemfile +0 -34
- data/gemfiles/typhoeus_old.gemfile.lock +0 -133
- data/script/ci.sh +0 -27
- data/spec/capture_warnings.rb +0 -73
- data/spec/quality_spec.rb +0 -51
- data/vcr.gemspec +0 -23
data/CONTRIBUTING.md
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
## Contributing
|
2
|
-
|
3
|
-
Install [bundler](http://gembundler.com/) and use it to install all the development dependencies:
|
4
|
-
|
5
|
-
```console
|
6
|
-
gem install bundler
|
7
|
-
bundle install
|
8
|
-
```
|
9
|
-
|
10
|
-
You should be able to run the tests now:
|
11
|
-
|
12
|
-
```console
|
13
|
-
bundle exec rake
|
14
|
-
```
|
15
|
-
|
16
|
-
VCR uses [RSpec 2](http://github.com/rspec/rspec) for unit tests. The specs are written in a very "focused" style, where each spec is concerned only with exercising the object under test, using mocks as necessary. You can run the specs using `rake spec`.
|
17
|
-
|
18
|
-
[Cucumber](http://cukes.info/) is used for end-to-end full stack integration tests that also function as VCR's documentation.
|
19
|
-
|
20
|
-
## Problems running bundle install?
|
21
|
-
|
22
|
-
If you get an error while running `bundle install`, it may be one of the "extras" gems which are not required for development. Try installing it without these gems.
|
23
|
-
|
24
|
-
```console
|
25
|
-
bundle install --without extras
|
26
|
-
```
|
data/Gemfile
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'appraisal'
|
4
|
-
|
5
|
-
gemspec
|
6
|
-
|
7
|
-
gem 'jruby-openssl', :platforms => :jruby
|
8
|
-
|
9
|
-
gem 'yard'
|
10
|
-
|
11
|
-
# Additional gems that are useful, but not required for development.
|
12
|
-
gem 'relish', '~> 0.6'
|
13
|
-
|
14
|
-
gem 'redcarpet', '~> 1.17.2', :platforms => :ruby
|
15
|
-
gem 'github-markup'
|
16
|
-
|
17
|
-
group :extras do
|
18
|
-
gem 'ruby-debug', :platforms => [:mri_18, :jruby]
|
19
|
-
|
20
|
-
gem 'debugger', :platforms => :mri_19
|
21
|
-
gem 'pry'
|
22
|
-
end
|
23
|
-
|
24
|
-
gem 'rake', '>= 0.9.2'
|
25
|
-
|
26
|
-
gem 'cucumber', '>= 1.1.4'
|
27
|
-
gem 'aruba', '>= 0.5'
|
28
|
-
gem 'rspec', '~> 3.1'
|
29
|
-
|
30
|
-
gem 'fakeweb', '>= 1.3.0'
|
31
|
-
gem 'webmock', '>= 1.14'
|
32
|
-
|
33
|
-
gem 'faraday', '>= 0.8'
|
34
|
-
gem 'httpclient', '>= 2.2'
|
35
|
-
gem 'excon', '>= 0.22'
|
36
|
-
|
37
|
-
# 0.6.2 cannot install on 1.8.7:
|
38
|
-
# https://github.com/travisjeffery/timecop/commit/cec7352a6655cceb0216db53eea630354ee63e3f
|
39
|
-
gem 'timecop', '0.6.1'
|
40
|
-
|
41
|
-
gem 'rack', '>= 1.3.6'
|
42
|
-
gem 'sinatra', '>= 1.3.2'
|
43
|
-
gem 'multi_json', '>= 1.0.3'
|
44
|
-
gem 'json', '>= 1.6.5'
|
45
|
-
gem 'simplecov', '>= 0.5.3'
|
46
|
-
|
47
|
-
gem 'redis', '>= 2.2.2'
|
48
|
-
gem 'typhoeus', '>= 0.6'
|
49
|
-
|
50
|
-
gem 'patron', '>= 0.4.15', :platform => :ruby
|
51
|
-
gem 'em-http-request', '>= 1.0.2', :platform => :ruby
|
52
|
-
gem 'curb', '>= 0.8.0', :platform => :ruby
|
53
|
-
gem 'yajl-ruby', '>= 1.1.0', :platform => :ruby
|
54
|
-
|
data/Gemfile.lock
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
vcr (2.9.3)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
addressable (2.3.5)
|
10
|
-
appraisal (0.5.2)
|
11
|
-
bundler
|
12
|
-
rake
|
13
|
-
archive-tar-minitar (0.5.2)
|
14
|
-
aruba (0.5.3)
|
15
|
-
childprocess (>= 0.3.6)
|
16
|
-
cucumber (>= 1.1.1)
|
17
|
-
rspec-expectations (>= 2.7.0)
|
18
|
-
builder (3.2.2)
|
19
|
-
childprocess (0.3.9)
|
20
|
-
ffi (~> 1.0, >= 1.0.11)
|
21
|
-
coderay (1.0.9)
|
22
|
-
columnize (0.3.6)
|
23
|
-
cookiejar (0.3.0)
|
24
|
-
crack (0.4.2)
|
25
|
-
safe_yaml (~> 1.0.0)
|
26
|
-
cucumber (1.3.8)
|
27
|
-
builder (>= 2.1.2)
|
28
|
-
diff-lcs (>= 1.1.3)
|
29
|
-
gherkin (~> 2.12.1)
|
30
|
-
multi_json (>= 1.7.5, < 2.0)
|
31
|
-
multi_test (>= 0.0.2)
|
32
|
-
curb (0.8.5)
|
33
|
-
debugger (1.6.2)
|
34
|
-
columnize (>= 0.3.1)
|
35
|
-
debugger-linecache (~> 1.2.0)
|
36
|
-
debugger-ruby_core_source (~> 1.2.3)
|
37
|
-
debugger-linecache (1.2.0)
|
38
|
-
debugger-ruby_core_source (1.2.3)
|
39
|
-
diff-lcs (1.2.5)
|
40
|
-
em-http-request (1.1.1)
|
41
|
-
addressable (>= 2.3.4)
|
42
|
-
cookiejar
|
43
|
-
em-socksify (>= 0.3)
|
44
|
-
eventmachine (>= 1.0.3)
|
45
|
-
http_parser.rb (>= 0.6.0.beta.2)
|
46
|
-
em-socksify (0.3.0)
|
47
|
-
eventmachine (>= 1.0.0.beta.4)
|
48
|
-
ethon (0.6.1)
|
49
|
-
ffi (>= 1.3.0)
|
50
|
-
mime-types (~> 1.18)
|
51
|
-
eventmachine (1.0.3)
|
52
|
-
excon (0.32.0)
|
53
|
-
fakeweb (1.3.0)
|
54
|
-
faraday (0.8.8)
|
55
|
-
multipart-post (~> 1.2.0)
|
56
|
-
ffi (1.9.3)
|
57
|
-
gherkin (2.12.2)
|
58
|
-
multi_json (~> 1.3)
|
59
|
-
github-markup (0.7.5)
|
60
|
-
http_parser.rb (0.6.0.beta.2)
|
61
|
-
httpclient (2.3.4.1)
|
62
|
-
json (1.8.1)
|
63
|
-
linecache (0.46)
|
64
|
-
rbx-require-relative (> 0.0.4)
|
65
|
-
method_source (0.8.2)
|
66
|
-
mime-types (1.25)
|
67
|
-
multi_json (1.8.2)
|
68
|
-
multi_test (0.0.2)
|
69
|
-
multipart-post (1.2.0)
|
70
|
-
patron (0.4.18)
|
71
|
-
pry (0.9.12.2)
|
72
|
-
coderay (~> 1.0.5)
|
73
|
-
method_source (~> 0.8)
|
74
|
-
slop (~> 3.4)
|
75
|
-
rack (1.5.2)
|
76
|
-
rack-protection (1.5.0)
|
77
|
-
rack
|
78
|
-
rake (10.1.0)
|
79
|
-
rbx-require-relative (0.0.9)
|
80
|
-
redcarpet (1.17.2)
|
81
|
-
redis (3.0.5)
|
82
|
-
relish (0.7)
|
83
|
-
archive-tar-minitar (>= 0.5.2)
|
84
|
-
json (>= 1.4.6)
|
85
|
-
rest-client (>= 1.6.1)
|
86
|
-
rest-client (1.6.7)
|
87
|
-
mime-types (>= 1.16)
|
88
|
-
rspec (3.1.0)
|
89
|
-
rspec-core (~> 3.1.0)
|
90
|
-
rspec-expectations (~> 3.1.0)
|
91
|
-
rspec-mocks (~> 3.1.0)
|
92
|
-
rspec-core (3.1.1)
|
93
|
-
rspec-support (~> 3.1.0)
|
94
|
-
rspec-expectations (3.1.0)
|
95
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
-
rspec-support (~> 3.1.0)
|
97
|
-
rspec-mocks (3.1.0)
|
98
|
-
rspec-support (~> 3.1.0)
|
99
|
-
rspec-support (3.1.0)
|
100
|
-
ruby-debug (0.10.4)
|
101
|
-
columnize (>= 0.1)
|
102
|
-
ruby-debug-base (~> 0.10.4.0)
|
103
|
-
ruby-debug-base (0.10.4)
|
104
|
-
linecache (>= 0.3)
|
105
|
-
safe_yaml (1.0.1)
|
106
|
-
simplecov (0.7.1)
|
107
|
-
multi_json (~> 1.0)
|
108
|
-
simplecov-html (~> 0.7.1)
|
109
|
-
simplecov-html (0.7.1)
|
110
|
-
sinatra (1.4.3)
|
111
|
-
rack (~> 1.4)
|
112
|
-
rack-protection (~> 1.4)
|
113
|
-
tilt (~> 1.3, >= 1.3.4)
|
114
|
-
slop (3.4.6)
|
115
|
-
tilt (1.4.1)
|
116
|
-
timecop (0.6.1)
|
117
|
-
typhoeus (0.6.6)
|
118
|
-
ethon (~> 0.6.1)
|
119
|
-
webmock (1.17.3)
|
120
|
-
addressable (>= 2.2.7)
|
121
|
-
crack (>= 0.3.2)
|
122
|
-
yajl-ruby (1.1.0)
|
123
|
-
yard (0.8.7.2)
|
124
|
-
|
125
|
-
PLATFORMS
|
126
|
-
ruby
|
127
|
-
|
128
|
-
DEPENDENCIES
|
129
|
-
appraisal
|
130
|
-
aruba (>= 0.5)
|
131
|
-
cucumber (>= 1.1.4)
|
132
|
-
curb (>= 0.8.0)
|
133
|
-
debugger
|
134
|
-
em-http-request (>= 1.0.2)
|
135
|
-
excon (>= 0.22)
|
136
|
-
fakeweb (>= 1.3.0)
|
137
|
-
faraday (>= 0.8)
|
138
|
-
github-markup
|
139
|
-
httpclient (>= 2.2)
|
140
|
-
jruby-openssl
|
141
|
-
json (>= 1.6.5)
|
142
|
-
multi_json (>= 1.0.3)
|
143
|
-
patron (>= 0.4.15)
|
144
|
-
pry
|
145
|
-
rack (>= 1.3.6)
|
146
|
-
rake (>= 0.9.2)
|
147
|
-
redcarpet (~> 1.17.2)
|
148
|
-
redis (>= 2.2.2)
|
149
|
-
relish (~> 0.6)
|
150
|
-
rspec (~> 3.1)
|
151
|
-
ruby-debug
|
152
|
-
simplecov (>= 0.5.3)
|
153
|
-
sinatra (>= 1.3.2)
|
154
|
-
timecop (= 0.6.1)
|
155
|
-
typhoeus (>= 0.6)
|
156
|
-
vcr!
|
157
|
-
webmock (>= 1.14)
|
158
|
-
yajl-ruby (>= 1.1.0)
|
159
|
-
yard
|
data/LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2010-2014 Myron Marston
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,243 +0,0 @@
|
|
1
|
-
# VCR
|
2
|
-
|
3
|
-
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
|
4
|
-
|
5
|
-
[![Gem Version](https://img.shields.io/gem/v/vcr.svg)](http://rubygems.org/gems/vcr) [![Build Status](https://img.shields.io/travis/vcr/vcr/master.svg)](https://travis-ci.org/vcr/vcr) [![Code Climate](https://img.shields.io/codeclimate/github/vcr/vcr.svg)](https://codeclimate.com/github/vcr/vcr)
|
6
|
-
|
7
|
-
## Synopsis
|
8
|
-
|
9
|
-
``` ruby
|
10
|
-
require 'rubygems'
|
11
|
-
require 'test/unit'
|
12
|
-
require 'vcr'
|
13
|
-
|
14
|
-
VCR.configure do |c|
|
15
|
-
c.cassette_library_dir = 'fixtures/vcr_cassettes'
|
16
|
-
c.hook_into :webmock # or :fakeweb
|
17
|
-
end
|
18
|
-
|
19
|
-
class VCRTest < Test::Unit::TestCase
|
20
|
-
def test_example_dot_com
|
21
|
-
VCR.use_cassette('synopsis') do
|
22
|
-
response = Net::HTTP.get_response(URI('http://www.iana.org/domains/reserved'))
|
23
|
-
assert_match /Example domains/, response.body
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
```
|
28
|
-
|
29
|
-
Run this test once, and VCR will record the http request to `fixtures/vcr_cassettes/synopsis.yml`. Run it again, and VCR
|
30
|
-
will replay the response from iana.org when the http request is made. This test is now fast (no real HTTP requests are
|
31
|
-
made anymore), deterministic (the test will continue to pass, even if you are offline, or iana.org goes down for
|
32
|
-
maintenance) and accurate (the response will contain the same headers and body you get from a real request).
|
33
|
-
|
34
|
-
## Features
|
35
|
-
|
36
|
-
* Automatically records and replays your HTTP interactions with minimal setup/configuration code.
|
37
|
-
* Supports and works with the HTTP stubbing facilities of multiple libraries. Currently, the
|
38
|
-
following are supported:
|
39
|
-
* [WebMock](https://github.com/bblimke/webmock)
|
40
|
-
* [Typhoeus](https://github.com/typhoeus/typhoeus)
|
41
|
-
* [Faraday](https://github.com/lostisland/faraday)
|
42
|
-
* [Excon](https://github.com/geemus/excon)
|
43
|
-
* [FakeWeb](https://github.com/chrisk/fakeweb) (deprecated)
|
44
|
-
* Supports multiple HTTP libraries:
|
45
|
-
* [Patron](http://github.com/toland/patron) (when using WebMock)
|
46
|
-
* [Curb](http://github.com/taf2/curb) (when using WebMock -- only supports Curl::Easy at the moment)
|
47
|
-
* [HTTPClient](http://github.com/nahi/httpclient) (when using WebMock)
|
48
|
-
* [em-http-request](http://github.com/igrigorik/em-http-request) (when using WebMock)
|
49
|
-
* [Net::HTTP](http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html) (when using FakeWeb and WebMock)
|
50
|
-
* [Typhoeus](https://github.com/typhoeus/typhoeus) (Typhoeus::Hydra, but not Typhoeus::Easy or Typhoeus::Multi)
|
51
|
-
* [Excon](https://github.com/geemus/excon)
|
52
|
-
* [Faraday](https://github.com/lostisland/faraday)
|
53
|
-
* And of course any library built on Net::HTTP, such as [Mechanize](http://github.com/sparklemotion/mechanize),
|
54
|
-
[HTTParty](http://github.com/jnunemaker/httparty) or [Rest Client](http://github.com/rest-client/rest-client).
|
55
|
-
* Request matching is configurable based on HTTP method, URI, host, path, body and headers, or you can easily
|
56
|
-
implement a custom request matcher to handle any need.
|
57
|
-
* The same request can receive different responses in different tests--just use different cassettes.
|
58
|
-
* The recorded requests and responses are stored on disk in a serialization format of your choice
|
59
|
-
(currently YAML and JSON are built in, and you can easily implement your own custom serializer)
|
60
|
-
and can easily be inspected and edited.
|
61
|
-
* Dynamic responses are supported using ERB.
|
62
|
-
* Automatically re-records cassettes on a configurable regular interval to keep them fresh and current.
|
63
|
-
* Disables all HTTP requests that you don't explicitly allow.
|
64
|
-
* Simple cucumber integration is provided using tags.
|
65
|
-
* Includes convenient RSpec macro and integration with RSpec 2 metadata.
|
66
|
-
* Known to work well with many popular ruby libraries including RSpec 1 & 2, Cucumber, Test::Unit,
|
67
|
-
Capybara, Mechanize, Rest-Client and HTTParty.
|
68
|
-
* Includes Rack and Faraday middleware.
|
69
|
-
|
70
|
-
## Usage
|
71
|
-
|
72
|
-
The docs come in two flavors:
|
73
|
-
|
74
|
-
* The [relish docs](https://relishapp.com/vcr/vcr/docs) contain
|
75
|
-
example-based documentation (VCR's cucumber suite, in fact). It's a
|
76
|
-
good place to look when you are first getting started with VCR, or if
|
77
|
-
you want to see an example of how to use a feature.
|
78
|
-
* The [rubydoc.info docs](http://rubydoc.info/gems/vcr/frames) contain
|
79
|
-
API documentation. The API docs contain detailed info about all of VCR's
|
80
|
-
public API.
|
81
|
-
|
82
|
-
See the [Upgrade](https://github.com/vcr/vcr/blob/master/Upgrade.md) doc
|
83
|
-
for info about what's new and changed in VCR 2.0.
|
84
|
-
|
85
|
-
There is also a Railscast, which will get you up and running in no-time http://railscasts.com/episodes/291-testing-with-vcr
|
86
|
-
|
87
|
-
## Release Policy
|
88
|
-
|
89
|
-
VCR follows the principles of [semantic versioning](http://semver.org/).
|
90
|
-
The [API documentation](http://rubydoc.info/gems/vcr/frames) define
|
91
|
-
VCR's public API. Patch level releases contain only bug fixes. Minor
|
92
|
-
releases contain backward-compatible new features. Major new releases
|
93
|
-
contain backwards-incompatible changes to the public API.
|
94
|
-
|
95
|
-
## Ruby Interpreter Compatibility
|
96
|
-
|
97
|
-
VCR has been tested on the following ruby interpreters:
|
98
|
-
|
99
|
-
* MRI 1.8.7
|
100
|
-
* MRI 1.9.2
|
101
|
-
* MRI 1.9.3
|
102
|
-
* MRI 2.0.0
|
103
|
-
* REE 1.8.7
|
104
|
-
* JRuby
|
105
|
-
* Rubinius
|
106
|
-
|
107
|
-
Note that as of VCR 2, 1.8.6 and 1.9.1 are not supported.
|
108
|
-
|
109
|
-
## Development
|
110
|
-
|
111
|
-
* Source hosted on [GitHub](http://github.com/vcr/vcr).
|
112
|
-
* Direct questions and discussions to the [IRC channel](irc://irc.freenode.net/vcr) or
|
113
|
-
the [mailing list](http://groups.google.com/group/vcr-ruby).
|
114
|
-
* Report issues on [GitHub Issues](http://github.com/vcr/vcr/issues).
|
115
|
-
* Pull requests are very welcome! Please include spec and/or feature coverage for every patch,
|
116
|
-
and create a topic branch for every separate change you make.
|
117
|
-
* See the [Contributing](https://github.com/vcr/vcr/blob/master/CONTRIBUTING.md)
|
118
|
-
guide for instructions on running the specs and features.
|
119
|
-
* Code quality metrics are checked by [Code Climate](https://codeclimate.com/github/vcr/vcr).
|
120
|
-
* Documentation is generated with [YARD](http://yardoc.org/) ([cheat sheet](http://cheat.errtheblog.com/s/yard)).
|
121
|
-
To generate while developing:
|
122
|
-
|
123
|
-
```
|
124
|
-
yard server --reload
|
125
|
-
```
|
126
|
-
|
127
|
-
## Thanks
|
128
|
-
|
129
|
-
* [Aslak Hellesøy](http://github.com/aslakhellesoy) for [Cucumber](http://github.com/aslakhellesoy/cucumber).
|
130
|
-
* [Bartosz Blimke](http://github.com/bblimke) for [WebMock](http://github.com/bblimke/webmock).
|
131
|
-
* [Chris Kampmeier](http://github.com/chrisk) for [FakeWeb](http://github.com/chrisk/fakeweb).
|
132
|
-
* [Chris Young](http://github.com/chrisyoung) for [NetRecorder](http://github.com/chrisyoung/netrecorder),
|
133
|
-
the inspiration for VCR.
|
134
|
-
* [David Balatero](https://github.com/dbalatero) and [Hans Hasselberg](https://github.com/i0rek)
|
135
|
-
for help with [Typhoeus](https://github.com/typhoeus/typhoeus) support.
|
136
|
-
* [Wesley Beary](https://github.com/geemus) for help with [Excon](https://github.com/geemus/excon)
|
137
|
-
support.
|
138
|
-
* [Jacob Green](https://github.com/Jacobkg) for help with ongoing VCR
|
139
|
-
maintenance.
|
140
|
-
|
141
|
-
Thanks also to the following people who have contributed patches or helpful suggestions:
|
142
|
-
|
143
|
-
* [Aaron Brethorst](http://github.com/aaronbrethorst)
|
144
|
-
* [Alexander Wenzowski](https://github.com/wenzowski)
|
145
|
-
* [Austen Ito](https://github.com/austenito)
|
146
|
-
* [Avdi Grimm](https://github.com/avdi)
|
147
|
-
* [Bartosz Blimke](http://github.com/bblimke)
|
148
|
-
* [Benjamin Oakes](https://github.com/benjaminoakes)
|
149
|
-
* [Ben Hutton](http://github.com/benhutton)
|
150
|
-
* [Bradley Isotope](https://github.com/bradleyisotope)
|
151
|
-
* [Carlos Kirkconnell](https://github.com/kirkconnell)
|
152
|
-
* [Chad Jolly](https://github.com/cjolly)
|
153
|
-
* [Chris Le](https://github.com/chrisle)
|
154
|
-
* [Chris Gunther](https://github.com/cgunther)
|
155
|
-
* [Eduardo Maia](https://github.com/emaiax)
|
156
|
-
* [Eric Allam](http://github.com/rubymaverick)
|
157
|
-
* [Ezekiel Templin](https://github.com/ezkl)
|
158
|
-
* [Flaviu Simihaian](https://github.com/closedbracket)
|
159
|
-
* [Gordon Wilson](https://github.com/gordoncww)
|
160
|
-
* [Hans Hasselberg](https://github.com/i0rek)
|
161
|
-
* [Herman Verschooten](https://github.com/Hermanverschooten)
|
162
|
-
* [Ian Cordasco](https://github.com/sigmavirus24)
|
163
|
-
* [Ingemar](https://github.com/ingemar)
|
164
|
-
* [Ilya Scharrenbroich](https://github.com/quidproquo)
|
165
|
-
* [Jacob Green](https://github.com/Jacobkg)
|
166
|
-
* [James Bence](https://github.com/jbence)
|
167
|
-
* [Jay Shepherd](https://github.com/jayshepherd)
|
168
|
-
* [Jeff Pollard](https://github.com/Fluxx)
|
169
|
-
* [Joe Nelson](https://github.com/begriffs)
|
170
|
-
* [Jonathan Tron](https://github.com/JonathanTron)
|
171
|
-
* [Justin Smestad](https://github.com/jsmestad)
|
172
|
-
* [Karl Baum](https://github.com/kbaum)
|
173
|
-
* [Kris Luminar](https://github.com/kris-luminar)
|
174
|
-
* [Kurt Funai](https://github.com/kurtfunai)
|
175
|
-
* [Luke van der Hoeven](https://github.com/plukevdh)
|
176
|
-
* [Mark Burns](https://github.com/markburns)
|
177
|
-
* [Max Riveiro](https://github.com/kavu)
|
178
|
-
* [Michael Lavrisha](https://github.com/vrish88)
|
179
|
-
* [Michiel de Mare](https://github.com/mdemare)
|
180
|
-
* [Mike Dalton](https://github.com/kcdragon)
|
181
|
-
* [Mislav Marohnić](https://github.com/mislav)
|
182
|
-
* [Nathaniel Bibler](https://github.com/nbibler)
|
183
|
-
* [Noah Davis](https://github.com/noahd1)
|
184
|
-
* [Oliver Searle-Barnes](https://github.com/opsb)
|
185
|
-
* [Omer Rauchwerger](https://github.com/rauchy)
|
186
|
-
* [Paco Guzmán](https://github.com/pacoguzman)
|
187
|
-
* [Paul Morgan](https://github.com/jumanjiman)
|
188
|
-
* [playupchris](https://github.com/playupchris)
|
189
|
-
* [Ron Smith](https://github.com/ronwsmith)
|
190
|
-
* [Ryan Bates](https://github.com/ryanb)
|
191
|
-
* [Ryan Burrows](https://github.com/rhburrows)
|
192
|
-
* [Ryan Castillo](https://github.com/rmcastil)
|
193
|
-
* [Sathya Sekaran](https://github.com/sfsekaran)
|
194
|
-
* [Scott Carleton](https://github.com/ScotterC)
|
195
|
-
* [Shay Frendt](https://github.com/shayfrendt)
|
196
|
-
* [Steve Faulkner](https://github.com/southpolesteve)
|
197
|
-
* [Stephen Anderson](https://github.com/bendycode)
|
198
|
-
* [Todd Lunter](https://github.com/tlunter)
|
199
|
-
* [Tyler Hunt](https://github.com/tylerhunt)
|
200
|
-
* [Uģis Ozols](https://github.com/ugisozols)
|
201
|
-
* [vzvu3k6k](https://github.com/vzvu3k6k)
|
202
|
-
* [Wesley Beary](https://github.com/geemus)
|
203
|
-
|
204
|
-
## Ports in other languages
|
205
|
-
|
206
|
-
* [Betamax](https://github.com/robfletcher/betamax) (Groovy/JVM)
|
207
|
-
* [Betamax](https://github.com/sigmavirus24/betamax) (Python)
|
208
|
-
* [Betamax](https://github.com/thegreatape/betamax) (Go)
|
209
|
-
* [Betamax](https://github.com/wjlroe/betamax) (Clojure)
|
210
|
-
* [Betamax.NET](https://github.com/mfloryan/Betamax.Net) (C#/.NET)
|
211
|
-
* [ExVCR](https://github.com/parroty/exvcr) (Elixir)
|
212
|
-
* [HAVCR](https://github.com/cordawyn/havcr) (Haskell)
|
213
|
-
* [Mimic](https://github.com/acoulton/mimic) (PHP/Kohana)
|
214
|
-
* [Nock-VCR](https://github.com/carbonfive/nock-vcr) (JavaScript/Node)
|
215
|
-
* [NSURLConnectionVCR](https://bitbucket.org/martijnthe/nsurlconnectionvcr) (Objective-C)
|
216
|
-
* [PHP-VCR](https://github.com/php-vcr/php-vcr) (PHP)
|
217
|
-
* [Sepia](https://github.com/linkedin/sepia) (Javascript/Node)
|
218
|
-
* [TapeDeck.js](https://github.com/EndangeredMassa/TapeDeck.js) (JavaScript)
|
219
|
-
* [VCR.js](https://github.com/elcuervo/vcr.js) (JavaScript)
|
220
|
-
* [VCR.py](https://github.com/kevin1024/vcrpy) (Python)
|
221
|
-
* [VCRURLConnection](https://github.com/dstnbrkr/VCRURLConnection) (Objective-C)
|
222
|
-
* [vcr-clj](https://github.com/ifesdjeen/vcr-clj) (Clojure)
|
223
|
-
* [VHS](https://github.com/diegoeche/vhs) (Erlang)
|
224
|
-
|
225
|
-
## Related Projects
|
226
|
-
|
227
|
-
* [Mr. Video](https://github.com/quidproquo/mr_video) (Rails engine for managing VCR cassettes and episodes)
|
228
|
-
|
229
|
-
|
230
|
-
## Similar Libraries in Ruby
|
231
|
-
|
232
|
-
* [Ephemeral Response](https://github.com/sandro/ephemeral_response)
|
233
|
-
* [Net::HTTP Spy](http://github.com/martinbtt/net-http-spy)
|
234
|
-
* [NetRecorder](https://github.com/chrisyoung/netrecorder)
|
235
|
-
* [Puffing Billy](https://github.com/oesmith/puffing-billy)
|
236
|
-
* [REST-assured](https://github.com/artemave/REST-assured)
|
237
|
-
* [Stale Fish](https://github.com/jsmestad/stale_fish)
|
238
|
-
* [WebFixtures](http://github.com/trydionel/web_fixtures)
|
239
|
-
|
240
|
-
## Copyright
|
241
|
-
|
242
|
-
Copyright (c) 2010-2014 Myron Marston. Released under the terms of the
|
243
|
-
MIT license. See LICENSE for details.
|