vcr 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.gitignore +1 -1
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +58 -1
  4. data/Gemfile +2 -4
  5. data/Gemfile.lock +26 -49
  6. data/README.md +92 -23
  7. data/Rakefile +6 -3
  8. data/features/fixtures/vcr_cassettes/1.9.1/record_all.yml +62 -0
  9. data/features/fixtures/vcr_cassettes/not_1.9.1/record_all.yml +61 -0
  10. data/features/http_client.feature +2 -2
  11. data/features/net_http.feature +15 -4
  12. data/features/record_response.feature +36 -7
  13. data/features/replay_recorded_response.feature +8 -8
  14. data/features/rspec.feature +100 -0
  15. data/features/step_definitions/net_http_steps.rb +13 -1
  16. data/features/step_definitions/vcr_steps.rb +26 -16
  17. data/features/support/env.rb +13 -5
  18. data/features/webmock.feature +4 -4
  19. data/lib/vcr.rb +5 -5
  20. data/lib/vcr/cassette.rb +55 -19
  21. data/lib/vcr/extensions/net_http.rb +2 -4
  22. data/lib/vcr/http_stubbing_adapters/fakeweb.rb +0 -4
  23. data/lib/vcr/http_stubbing_adapters/webmock.rb +2 -9
  24. data/lib/vcr/internet_connection.rb +13 -0
  25. data/lib/vcr/ping.rb +26 -0
  26. data/lib/vcr/rspec.rb +39 -0
  27. data/lib/vcr/version.rb +1 -1
  28. data/spec/cassette_spec.rb +160 -69
  29. data/spec/config_spec.rb +1 -1
  30. data/spec/cucumber_tags_spec.rb +3 -2
  31. data/spec/deprecations_spec.rb +1 -1
  32. data/spec/extensions/net_http_response_spec.rb +2 -4
  33. data/spec/extensions/net_http_spec.rb +3 -1
  34. data/spec/fixtures/1.9.1/cassette_spec/with_localhost_requests.yml +23 -0
  35. data/spec/fixtures/not_1.9.1/cassette_spec/with_localhost_requests.yml +23 -0
  36. data/spec/http_stubbing_adapters/fakeweb_spec.rb +3 -9
  37. data/spec/http_stubbing_adapters/webmock_spec.rb +7 -18
  38. data/spec/internet_connection_spec.rb +19 -0
  39. data/spec/monkey_patches.rb +45 -6
  40. data/spec/request_matcher_spec.rb +1 -1
  41. data/spec/rspec_spec.rb +46 -0
  42. data/spec/spec_helper.rb +6 -11
  43. data/spec/structs_spec.rb +1 -1
  44. data/spec/support/fixnum_extension.rb +10 -0
  45. data/spec/support/http_library_adapters.rb +31 -2
  46. data/spec/support/ruby_interpreter.rb +7 -0
  47. data/spec/support/vcr_localhost_server.rb +86 -44
  48. data/spec/support/webmock_macros.rb +14 -0
  49. data/spec/vcr_spec.rb +1 -1
  50. data/spec/version_spec.rb +1 -1
  51. data/vcr.gemspec +10 -6
  52. 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
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
  describe VCR do
4
4
  def insert_cassette
data/spec/version_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'spec_helper'
2
2
 
3
3
  describe "VCR.version" do
4
4
  subject { VCR.version }
data/vcr.gemspec CHANGED
@@ -1,4 +1,5 @@
1
- require File.expand_path("../lib/vcr/version", __FILE__)
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.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
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.beta.20',
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.3.5',
30
+ 'webmock' => '~> 1.4.0',
28
31
 
29
32
  'httpclient' => '~> 2.1.5.2',
30
33
 
31
- 'capybara' => '~> 0.3.9',
32
- 'rack' => '1.2.0'
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: 23
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
9
8
  - 2
10
- version: 1.1.2
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-09-09 00:00:00 -07:00
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: 62196427
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
- - beta
82
- - 20
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: &id005 !ruby/object:Gem::Requirement
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: 31
108
+ hash: 19
95
109
  segments:
96
110
  - 1
97
- - 2
111
+ - 1
98
112
  - 0
99
- version: 1.2.0
100
- requirement: *id005
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: &id006 !ruby/object:Gem::Requirement
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: *id006
146
+ requirement: *id008
117
147
  type: :development
118
148
  name: bundler
119
149
  prerelease: false
120
150
  - !ruby/object:Gem::Dependency
121
- version_requirements: &id007 !ruby/object:Gem::Requirement
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: *id007
162
+ requirement: *id009
133
163
  type: :development
134
164
  name: cucumber
135
165
  prerelease: false
136
166
  - !ruby/object:Gem::Dependency
137
- version_requirements: &id008 !ruby/object:Gem::Requirement
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: 1
172
+ hash: 7
143
173
  segments:
174
+ - 1
175
+ - 4
144
176
  - 0
145
- - 3
146
- - 9
147
- version: 0.3.9
148
- requirement: *id008
177
+ version: 1.4.0
178
+ requirement: *id010
149
179
  type: :development
150
- name: capybara
180
+ name: webmock
151
181
  prerelease: false
152
182
  - !ruby/object:Gem::Dependency
153
- version_requirements: &id009 !ruby/object:Gem::Requirement
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: 17
188
+ hash: 19
159
189
  segments:
160
- - 1
161
- - 3
162
- - 5
163
- version: 1.3.5
164
- requirement: *id009
190
+ - 0
191
+ - 7
192
+ - 8
193
+ version: 0.7.8
194
+ requirement: *id011
165
195
  type: :development
166
- name: webmock
196
+ name: curb
167
197
  prerelease: false
168
198
  - !ruby/object:Gem::Dependency
169
- version_requirements: &id010 !ruby/object:Gem::Requirement
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: *id010
210
+ requirement: *id012
181
211
  type: :development
182
212
  name: patron
183
213
  prerelease: false
184
214
  - !ruby/object:Gem::Dependency
185
- version_requirements: &id011 !ruby/object:Gem::Requirement
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: *id011
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