vcr 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/.gitmodules +3 -0
- data/CHANGELOG.md +58 -1
- data/Gemfile +2 -4
- data/Gemfile.lock +26 -49
- data/README.md +92 -23
- data/Rakefile +6 -3
- data/features/fixtures/vcr_cassettes/1.9.1/record_all.yml +62 -0
- data/features/fixtures/vcr_cassettes/not_1.9.1/record_all.yml +61 -0
- data/features/http_client.feature +2 -2
- data/features/net_http.feature +15 -4
- data/features/record_response.feature +36 -7
- data/features/replay_recorded_response.feature +8 -8
- data/features/rspec.feature +100 -0
- data/features/step_definitions/net_http_steps.rb +13 -1
- data/features/step_definitions/vcr_steps.rb +26 -16
- data/features/support/env.rb +13 -5
- data/features/webmock.feature +4 -4
- data/lib/vcr.rb +5 -5
- data/lib/vcr/cassette.rb +55 -19
- data/lib/vcr/extensions/net_http.rb +2 -4
- data/lib/vcr/http_stubbing_adapters/fakeweb.rb +0 -4
- data/lib/vcr/http_stubbing_adapters/webmock.rb +2 -9
- data/lib/vcr/internet_connection.rb +13 -0
- data/lib/vcr/ping.rb +26 -0
- data/lib/vcr/rspec.rb +39 -0
- data/lib/vcr/version.rb +1 -1
- data/spec/cassette_spec.rb +160 -69
- data/spec/config_spec.rb +1 -1
- data/spec/cucumber_tags_spec.rb +3 -2
- data/spec/deprecations_spec.rb +1 -1
- data/spec/extensions/net_http_response_spec.rb +2 -4
- data/spec/extensions/net_http_spec.rb +3 -1
- data/spec/fixtures/1.9.1/cassette_spec/with_localhost_requests.yml +23 -0
- data/spec/fixtures/not_1.9.1/cassette_spec/with_localhost_requests.yml +23 -0
- data/spec/http_stubbing_adapters/fakeweb_spec.rb +3 -9
- data/spec/http_stubbing_adapters/webmock_spec.rb +7 -18
- data/spec/internet_connection_spec.rb +19 -0
- data/spec/monkey_patches.rb +45 -6
- data/spec/request_matcher_spec.rb +1 -1
- data/spec/rspec_spec.rb +46 -0
- data/spec/spec_helper.rb +6 -11
- data/spec/structs_spec.rb +1 -1
- data/spec/support/fixnum_extension.rb +10 -0
- data/spec/support/http_library_adapters.rb +31 -2
- data/spec/support/ruby_interpreter.rb +7 -0
- data/spec/support/vcr_localhost_server.rb +86 -44
- data/spec/support/webmock_macros.rb +14 -0
- data/spec/vcr_spec.rb +1 -1
- data/spec/version_spec.rb +1 -1
- data/vcr.gemspec +10 -6
- metadata +155 -39
@@ -0,0 +1,14 @@
|
|
1
|
+
module WebMockMacros
|
2
|
+
def without_webmock_callbacks
|
3
|
+
before(:all) do
|
4
|
+
@original_webmock_callbacks = ::WebMock::CallbackRegistry.callbacks
|
5
|
+
::WebMock::CallbackRegistry.reset
|
6
|
+
end
|
7
|
+
|
8
|
+
after(:all) do
|
9
|
+
@original_webmock_callbacks.each do |cb|
|
10
|
+
::WebMock::CallbackRegistry.add_callback(cb[:options], cb[:block])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/spec/vcr_spec.rb
CHANGED
data/spec/version_spec.rb
CHANGED
data/vcr.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
+
require "vcr/version"
|
2
3
|
|
3
4
|
Gem::Specification.new do |s|
|
4
5
|
s.name = "vcr"
|
@@ -9,7 +10,8 @@ Gem::Specification.new do |s|
|
|
9
10
|
s.email = "myron.marston@gmail.com"
|
10
11
|
s.require_path = "lib"
|
11
12
|
s.files = `git ls-files`.split("\n")
|
12
|
-
s.
|
13
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
13
15
|
|
14
16
|
s.version = VCR.version
|
15
17
|
s.platform = Gem::Platform::RUBY
|
@@ -20,16 +22,17 @@ Gem::Specification.new do |s|
|
|
20
22
|
'bundler' => '~> 1.0.0',
|
21
23
|
'rake' => '~> 0.8.7',
|
22
24
|
|
23
|
-
'rspec' => '~> 2.0.0
|
25
|
+
'rspec' => '~> 2.0.0',
|
24
26
|
'cucumber' => '~> 0.8.5',
|
27
|
+
'aruba' => '~> 0.2.1',
|
25
28
|
|
26
29
|
'fakeweb' => '~> 1.3.0',
|
27
|
-
'webmock' => '~> 1.
|
30
|
+
'webmock' => '~> 1.4.0',
|
28
31
|
|
29
32
|
'httpclient' => '~> 2.1.5.2',
|
30
33
|
|
31
|
-
'
|
32
|
-
'rack' => '1.
|
34
|
+
'timecop' => '~> 0.3.5',
|
35
|
+
'rack' => '1.1.0'
|
33
36
|
}.each do |lib, version|
|
34
37
|
s.add_development_dependency lib, version
|
35
38
|
end
|
@@ -37,6 +40,7 @@ Gem::Specification.new do |s|
|
|
37
40
|
{
|
38
41
|
'patron' => '~> 0.4.6',
|
39
42
|
'em-http-request' => '~> 0.2.7',
|
43
|
+
'curb' => '~> 0.7.8'
|
40
44
|
}.each do |lib, version|
|
41
45
|
s.add_development_dependency lib, version
|
42
46
|
end unless RUBY_PLATFORM == 'java'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
- 1
|
9
8
|
- 2
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Myron Marston
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-13 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -73,36 +73,66 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
hash:
|
76
|
+
hash: 25
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
- 3
|
80
|
+
- 5
|
81
|
+
version: 0.3.5
|
82
|
+
requirement: *id004
|
83
|
+
type: :development
|
84
|
+
name: timecop
|
85
|
+
prerelease: false
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ~>
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 15
|
77
93
|
segments:
|
78
94
|
- 2
|
79
95
|
- 0
|
80
96
|
- 0
|
81
|
-
|
82
|
-
|
83
|
-
version: 2.0.0.beta.20
|
84
|
-
requirement: *id004
|
97
|
+
version: 2.0.0
|
98
|
+
requirement: *id005
|
85
99
|
type: :development
|
86
100
|
name: rspec
|
87
101
|
prerelease: false
|
88
102
|
- !ruby/object:Gem::Dependency
|
89
|
-
version_requirements: &
|
103
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
90
104
|
none: false
|
91
105
|
requirements:
|
92
106
|
- - "="
|
93
107
|
- !ruby/object:Gem::Version
|
94
|
-
hash:
|
108
|
+
hash: 19
|
95
109
|
segments:
|
96
110
|
- 1
|
97
|
-
-
|
111
|
+
- 1
|
98
112
|
- 0
|
99
|
-
version: 1.
|
100
|
-
requirement: *
|
113
|
+
version: 1.1.0
|
114
|
+
requirement: *id006
|
101
115
|
type: :development
|
102
116
|
name: rack
|
103
117
|
prerelease: false
|
104
118
|
- !ruby/object:Gem::Dependency
|
105
|
-
version_requirements: &
|
119
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
hash: 21
|
125
|
+
segments:
|
126
|
+
- 0
|
127
|
+
- 2
|
128
|
+
- 1
|
129
|
+
version: 0.2.1
|
130
|
+
requirement: *id007
|
131
|
+
type: :development
|
132
|
+
name: aruba
|
133
|
+
prerelease: false
|
134
|
+
- !ruby/object:Gem::Dependency
|
135
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
106
136
|
none: false
|
107
137
|
requirements:
|
108
138
|
- - ~>
|
@@ -113,12 +143,12 @@ dependencies:
|
|
113
143
|
- 0
|
114
144
|
- 0
|
115
145
|
version: 1.0.0
|
116
|
-
requirement: *
|
146
|
+
requirement: *id008
|
117
147
|
type: :development
|
118
148
|
name: bundler
|
119
149
|
prerelease: false
|
120
150
|
- !ruby/object:Gem::Dependency
|
121
|
-
version_requirements: &
|
151
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
122
152
|
none: false
|
123
153
|
requirements:
|
124
154
|
- - ~>
|
@@ -129,44 +159,44 @@ dependencies:
|
|
129
159
|
- 8
|
130
160
|
- 5
|
131
161
|
version: 0.8.5
|
132
|
-
requirement: *
|
162
|
+
requirement: *id009
|
133
163
|
type: :development
|
134
164
|
name: cucumber
|
135
165
|
prerelease: false
|
136
166
|
- !ruby/object:Gem::Dependency
|
137
|
-
version_requirements: &
|
167
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
138
168
|
none: false
|
139
169
|
requirements:
|
140
170
|
- - ~>
|
141
171
|
- !ruby/object:Gem::Version
|
142
|
-
hash:
|
172
|
+
hash: 7
|
143
173
|
segments:
|
174
|
+
- 1
|
175
|
+
- 4
|
144
176
|
- 0
|
145
|
-
|
146
|
-
|
147
|
-
version: 0.3.9
|
148
|
-
requirement: *id008
|
177
|
+
version: 1.4.0
|
178
|
+
requirement: *id010
|
149
179
|
type: :development
|
150
|
-
name:
|
180
|
+
name: webmock
|
151
181
|
prerelease: false
|
152
182
|
- !ruby/object:Gem::Dependency
|
153
|
-
version_requirements: &
|
183
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
154
184
|
none: false
|
155
185
|
requirements:
|
156
186
|
- - ~>
|
157
187
|
- !ruby/object:Gem::Version
|
158
|
-
hash:
|
188
|
+
hash: 19
|
159
189
|
segments:
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
version:
|
164
|
-
requirement: *
|
190
|
+
- 0
|
191
|
+
- 7
|
192
|
+
- 8
|
193
|
+
version: 0.7.8
|
194
|
+
requirement: *id011
|
165
195
|
type: :development
|
166
|
-
name:
|
196
|
+
name: curb
|
167
197
|
prerelease: false
|
168
198
|
- !ruby/object:Gem::Dependency
|
169
|
-
version_requirements: &
|
199
|
+
version_requirements: &id012 !ruby/object:Gem::Requirement
|
170
200
|
none: false
|
171
201
|
requirements:
|
172
202
|
- - ~>
|
@@ -177,12 +207,12 @@ dependencies:
|
|
177
207
|
- 4
|
178
208
|
- 6
|
179
209
|
version: 0.4.6
|
180
|
-
requirement: *
|
210
|
+
requirement: *id012
|
181
211
|
type: :development
|
182
212
|
name: patron
|
183
213
|
prerelease: false
|
184
214
|
- !ruby/object:Gem::Dependency
|
185
|
-
version_requirements: &
|
215
|
+
version_requirements: &id013 !ruby/object:Gem::Requirement
|
186
216
|
none: false
|
187
217
|
requirements:
|
188
218
|
- - ~>
|
@@ -193,7 +223,7 @@ dependencies:
|
|
193
223
|
- 2
|
194
224
|
- 7
|
195
225
|
version: 0.2.7
|
196
|
-
requirement: *
|
226
|
+
requirement: *id013
|
197
227
|
type: :development
|
198
228
|
name: em-http-request
|
199
229
|
prerelease: false
|
@@ -208,6 +238,7 @@ extra_rdoc_files: []
|
|
208
238
|
files:
|
209
239
|
- .document
|
210
240
|
- .gitignore
|
241
|
+
- .gitmodules
|
211
242
|
- CHANGELOG.md
|
212
243
|
- Gemfile
|
213
244
|
- Gemfile.lock
|
@@ -223,6 +254,7 @@ files:
|
|
223
254
|
- features/fixtures/vcr_cassettes/1.9.1/match_requests_on.yml
|
224
255
|
- features/fixtures/vcr_cassettes/1.9.1/nested_replay_cassette.yml
|
225
256
|
- features/fixtures/vcr_cassettes/1.9.1/not_the_real_response.yml
|
257
|
+
- features/fixtures/vcr_cassettes/1.9.1/record_all.yml
|
226
258
|
- features/fixtures/vcr_cassettes/1.9.1/replay_localhost_cassette.yml
|
227
259
|
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/regex_cassette.yml
|
228
260
|
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette1.yml
|
@@ -232,11 +264,13 @@ files:
|
|
232
264
|
- features/fixtures/vcr_cassettes/not_1.9.1/match_requests_on.yml
|
233
265
|
- features/fixtures/vcr_cassettes/not_1.9.1/nested_replay_cassette.yml
|
234
266
|
- features/fixtures/vcr_cassettes/not_1.9.1/not_the_real_response.yml
|
267
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/record_all.yml
|
235
268
|
- features/fixtures/vcr_cassettes/not_1.9.1/replay_localhost_cassette.yml
|
236
269
|
- features/http_client.feature
|
237
270
|
- features/net_http.feature
|
238
271
|
- features/record_response.feature
|
239
272
|
- features/replay_recorded_response.feature
|
273
|
+
- features/rspec.feature
|
240
274
|
- features/step_definitions/http_client_steps.rb
|
241
275
|
- features/step_definitions/net_http_steps.rb
|
242
276
|
- features/step_definitions/vcr_steps.rb
|
@@ -252,7 +286,10 @@ files:
|
|
252
286
|
- lib/vcr/http_stubbing_adapters/common.rb
|
253
287
|
- lib/vcr/http_stubbing_adapters/fakeweb.rb
|
254
288
|
- lib/vcr/http_stubbing_adapters/webmock.rb
|
289
|
+
- lib/vcr/internet_connection.rb
|
290
|
+
- lib/vcr/ping.rb
|
255
291
|
- lib/vcr/request_matcher.rb
|
292
|
+
- lib/vcr/rspec.rb
|
256
293
|
- lib/vcr/structs.rb
|
257
294
|
- lib/vcr/version.rb
|
258
295
|
- spec/cassette_spec.rb
|
@@ -283,16 +320,21 @@ files:
|
|
283
320
|
- spec/fixtures/not_1.9.1/match_requests_on.yml
|
284
321
|
- spec/http_stubbing_adapters/fakeweb_spec.rb
|
285
322
|
- spec/http_stubbing_adapters/webmock_spec.rb
|
323
|
+
- spec/internet_connection_spec.rb
|
286
324
|
- spec/monkey_patches.rb
|
287
325
|
- spec/request_matcher_spec.rb
|
326
|
+
- spec/rspec_spec.rb
|
288
327
|
- spec/spec_helper.rb
|
289
328
|
- spec/structs_spec.rb
|
290
329
|
- spec/support/disable_warnings.rb
|
330
|
+
- spec/support/fixnum_extension.rb
|
291
331
|
- spec/support/http_library_adapters.rb
|
292
332
|
- spec/support/http_stubbing_adapter.rb
|
293
333
|
- spec/support/pending_on_heroku.rb
|
334
|
+
- spec/support/ruby_interpreter.rb
|
294
335
|
- spec/support/temp_cassette_library_dir.rb
|
295
336
|
- spec/support/vcr_localhost_server.rb
|
337
|
+
- spec/support/webmock_macros.rb
|
296
338
|
- spec/vcr_spec.rb
|
297
339
|
- spec/version_spec.rb
|
298
340
|
- vcr.gemspec
|
@@ -334,5 +376,79 @@ rubygems_version: 1.3.7
|
|
334
376
|
signing_key:
|
335
377
|
specification_version: 3
|
336
378
|
summary: Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
|
337
|
-
test_files:
|
338
|
-
|
379
|
+
test_files:
|
380
|
+
- features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/regex_cassette.yml
|
381
|
+
- features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette1.yml
|
382
|
+
- features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette2.yml
|
383
|
+
- features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette3.yml
|
384
|
+
- features/fixtures/vcr_cassettes/1.9.1/erb_cassette.yml
|
385
|
+
- features/fixtures/vcr_cassettes/1.9.1/match_requests_on.yml
|
386
|
+
- features/fixtures/vcr_cassettes/1.9.1/nested_replay_cassette.yml
|
387
|
+
- features/fixtures/vcr_cassettes/1.9.1/not_the_real_response.yml
|
388
|
+
- features/fixtures/vcr_cassettes/1.9.1/record_all.yml
|
389
|
+
- features/fixtures/vcr_cassettes/1.9.1/replay_localhost_cassette.yml
|
390
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/regex_cassette.yml
|
391
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette1.yml
|
392
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette2.yml
|
393
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette3.yml
|
394
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/erb_cassette.yml
|
395
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/match_requests_on.yml
|
396
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/nested_replay_cassette.yml
|
397
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/not_the_real_response.yml
|
398
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/record_all.yml
|
399
|
+
- features/fixtures/vcr_cassettes/not_1.9.1/replay_localhost_cassette.yml
|
400
|
+
- features/http_client.feature
|
401
|
+
- features/net_http.feature
|
402
|
+
- features/record_response.feature
|
403
|
+
- features/replay_recorded_response.feature
|
404
|
+
- features/rspec.feature
|
405
|
+
- features/step_definitions/http_client_steps.rb
|
406
|
+
- features/step_definitions/net_http_steps.rb
|
407
|
+
- features/step_definitions/vcr_steps.rb
|
408
|
+
- features/support/env.rb
|
409
|
+
- features/webmock.feature
|
410
|
+
- spec/cassette_spec.rb
|
411
|
+
- spec/config_spec.rb
|
412
|
+
- spec/cucumber_tags_spec.rb
|
413
|
+
- spec/deprecations_spec.rb
|
414
|
+
- spec/extensions/net_http_response_spec.rb
|
415
|
+
- spec/extensions/net_http_spec.rb
|
416
|
+
- spec/fixtures/1.9.1/0_3_1_cassette.yml
|
417
|
+
- spec/fixtures/1.9.1/cassette_spec/erb_with_no_vars.yml
|
418
|
+
- spec/fixtures/1.9.1/cassette_spec/erb_with_vars.yml
|
419
|
+
- spec/fixtures/1.9.1/cassette_spec/example.yml
|
420
|
+
- spec/fixtures/1.9.1/cassette_spec/with_localhost_requests.yml
|
421
|
+
- spec/fixtures/1.9.1/example_net_http.yml
|
422
|
+
- spec/fixtures/1.9.1/example_net_http_request.yml
|
423
|
+
- spec/fixtures/1.9.1/example_net_http_response.yml
|
424
|
+
- spec/fixtures/1.9.1/fake_example.com_responses.yml
|
425
|
+
- spec/fixtures/1.9.1/match_requests_on.yml
|
426
|
+
- spec/fixtures/not_1.9.1/0_3_1_cassette.yml
|
427
|
+
- spec/fixtures/not_1.9.1/cassette_spec/erb_with_no_vars.yml
|
428
|
+
- spec/fixtures/not_1.9.1/cassette_spec/erb_with_vars.yml
|
429
|
+
- spec/fixtures/not_1.9.1/cassette_spec/example.yml
|
430
|
+
- spec/fixtures/not_1.9.1/cassette_spec/with_localhost_requests.yml
|
431
|
+
- spec/fixtures/not_1.9.1/example_net_http.yml
|
432
|
+
- spec/fixtures/not_1.9.1/example_net_http_request.yml
|
433
|
+
- spec/fixtures/not_1.9.1/example_net_http_response.yml
|
434
|
+
- spec/fixtures/not_1.9.1/fake_example.com_responses.yml
|
435
|
+
- spec/fixtures/not_1.9.1/match_requests_on.yml
|
436
|
+
- spec/http_stubbing_adapters/fakeweb_spec.rb
|
437
|
+
- spec/http_stubbing_adapters/webmock_spec.rb
|
438
|
+
- spec/internet_connection_spec.rb
|
439
|
+
- spec/monkey_patches.rb
|
440
|
+
- spec/request_matcher_spec.rb
|
441
|
+
- spec/rspec_spec.rb
|
442
|
+
- spec/spec_helper.rb
|
443
|
+
- spec/structs_spec.rb
|
444
|
+
- spec/support/disable_warnings.rb
|
445
|
+
- spec/support/fixnum_extension.rb
|
446
|
+
- spec/support/http_library_adapters.rb
|
447
|
+
- spec/support/http_stubbing_adapter.rb
|
448
|
+
- spec/support/pending_on_heroku.rb
|
449
|
+
- spec/support/ruby_interpreter.rb
|
450
|
+
- spec/support/temp_cassette_library_dir.rb
|
451
|
+
- spec/support/vcr_localhost_server.rb
|
452
|
+
- spec/support/webmock_macros.rb
|
453
|
+
- spec/vcr_spec.rb
|
454
|
+
- spec/version_spec.rb
|