vcr 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/.document +5 -0
  2. data/.gitignore +27 -0
  3. data/CHANGELOG.md +13 -0
  4. data/Gemfile +24 -0
  5. data/Gemfile.lock +119 -0
  6. data/README.md +3 -6
  7. data/Rakefile +70 -0
  8. data/benchmarks/http_stubbing_libraries.rb +59 -0
  9. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/regex_cassette.yml +43 -0
  10. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette1.yml +43 -0
  11. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette2.yml +63 -0
  12. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette3.yml +85 -0
  13. data/features/fixtures/vcr_cassettes/1.9.1/erb_cassette.yml +36 -0
  14. data/features/fixtures/vcr_cassettes/1.9.1/match_requests_on.yml +35 -0
  15. data/features/fixtures/vcr_cassettes/1.9.1/nested_replay_cassette.yml +32 -0
  16. data/features/fixtures/vcr_cassettes/1.9.1/not_the_real_response.yml +43 -0
  17. data/features/fixtures/vcr_cassettes/1.9.1/replay_localhost_cassette.yml +32 -0
  18. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/regex_cassette.yml +43 -0
  19. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette1.yml +43 -0
  20. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette2.yml +47 -0
  21. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette3.yml +85 -0
  22. data/features/fixtures/vcr_cassettes/not_1.9.1/erb_cassette.yml +36 -0
  23. data/features/fixtures/vcr_cassettes/not_1.9.1/match_requests_on.yml +35 -0
  24. data/features/fixtures/vcr_cassettes/not_1.9.1/nested_replay_cassette.yml +24 -0
  25. data/features/fixtures/vcr_cassettes/not_1.9.1/not_the_real_response.yml +43 -0
  26. data/features/fixtures/vcr_cassettes/not_1.9.1/replay_localhost_cassette.yml +32 -0
  27. data/features/http_client.feature +16 -0
  28. data/features/net_http.feature +27 -0
  29. data/features/record_response.feature +66 -0
  30. data/features/replay_recorded_response.feature +96 -0
  31. data/features/step_definitions/http_client_steps.rb +7 -0
  32. data/features/step_definitions/net_http_steps.rb +37 -0
  33. data/features/step_definitions/vcr_steps.rb +240 -0
  34. data/features/support/env.rb +104 -0
  35. data/features/webmock.feature +26 -0
  36. data/lib/vcr.rb +2 -2
  37. data/lib/vcr/extensions/net_http.rb +0 -8
  38. data/lib/vcr/http_stubbing_adapters/common.rb +39 -0
  39. data/lib/vcr/http_stubbing_adapters/fakeweb.rb +74 -70
  40. data/lib/vcr/http_stubbing_adapters/webmock.rb +61 -62
  41. data/lib/vcr/version.rb +1 -1
  42. data/spec/cassette_spec.rb +280 -0
  43. data/spec/config_spec.rb +76 -0
  44. data/spec/cucumber_tags_spec.rb +55 -0
  45. data/spec/deprecations_spec.rb +52 -0
  46. data/spec/extensions/net_http_response_spec.rb +85 -0
  47. data/spec/extensions/net_http_spec.rb +77 -0
  48. data/spec/fixtures/1.9.1/0_3_1_cassette.yml +29 -0
  49. data/spec/fixtures/1.9.1/cassette_spec/erb_with_no_vars.yml +32 -0
  50. data/spec/fixtures/1.9.1/cassette_spec/erb_with_vars.yml +32 -0
  51. data/spec/fixtures/1.9.1/cassette_spec/example.yml +110 -0
  52. data/spec/fixtures/1.9.1/cassette_spec/with_localhost_requests.yml +86 -0
  53. data/spec/fixtures/1.9.1/example_net_http.yml +14 -0
  54. data/spec/fixtures/1.9.1/example_net_http_request.yml +12 -0
  55. data/spec/fixtures/1.9.1/example_net_http_response.yml +25 -0
  56. data/spec/fixtures/1.9.1/fake_example.com_responses.yml +106 -0
  57. data/spec/fixtures/1.9.1/match_requests_on.yml +185 -0
  58. data/spec/fixtures/not_1.9.1/0_3_1_cassette.yml +29 -0
  59. data/spec/fixtures/not_1.9.1/cassette_spec/erb_with_no_vars.yml +32 -0
  60. data/spec/fixtures/not_1.9.1/cassette_spec/erb_with_vars.yml +32 -0
  61. data/spec/fixtures/not_1.9.1/cassette_spec/example.yml +110 -0
  62. data/spec/fixtures/not_1.9.1/cassette_spec/with_localhost_requests.yml +86 -0
  63. data/spec/fixtures/not_1.9.1/example_net_http.yml +14 -0
  64. data/spec/fixtures/not_1.9.1/example_net_http_request.yml +12 -0
  65. data/spec/fixtures/not_1.9.1/example_net_http_response.yml +25 -0
  66. data/spec/fixtures/not_1.9.1/fake_example.com_responses.yml +106 -0
  67. data/spec/fixtures/not_1.9.1/match_requests_on.yml +185 -0
  68. data/spec/http_stubbing_adapters/fakeweb_spec.rb +35 -0
  69. data/spec/http_stubbing_adapters/webmock_spec.rb +35 -0
  70. data/spec/request_matcher_spec.rb +194 -0
  71. data/spec/spec_helper.rb +40 -0
  72. data/spec/structs_spec.rb +121 -0
  73. data/spec/support/disable_warnings.rb +12 -0
  74. data/spec/support/http_library_adapters.rb +272 -0
  75. data/spec/support/http_stubbing_adapter.rb +100 -0
  76. data/spec/support/pending_on_heroku.rb +14 -0
  77. data/spec/support/temp_cassette_library_dir.rb +16 -0
  78. data/spec/support/vcr_localhost_server.rb +53 -0
  79. data/spec/vcr_spec.rb +198 -0
  80. data/spec/version_spec.rb +11 -0
  81. data/vcr.gemspec +43 -0
  82. metadata +134 -73
  83. data/lib/vcr/http_stubbing_adapters/base.rb +0 -36
  84. data/lib/vcr/version.rbc +0 -572
@@ -1,36 +0,0 @@
1
- module VCR
2
- module HttpStubbingAdapters
3
- autoload :FakeWeb, 'vcr/http_stubbing_adapters/fakeweb'
4
- autoload :WebMock, 'vcr/http_stubbing_adapters/webmock'
5
-
6
- class UnsupportedRequestMatchAttributeError < ArgumentError; end
7
-
8
- class Base
9
- class << self
10
- def with_http_connections_allowed_set_to(value)
11
- original_value = http_connections_allowed?
12
- self.http_connections_allowed = value
13
- begin
14
- yield
15
- ensure
16
- self.http_connections_allowed = original_value
17
- end
18
- end
19
-
20
- def meets_version_requirement?(version, required_version)
21
- major, minor, patch = *version.split('.').map { |v| v.to_i }
22
- req_major, req_minor, req_patch = *required_version.split('.').map { |v| v.to_i }
23
-
24
- return false if major < req_major
25
- return true if major > req_major
26
-
27
- return false if minor < req_minor
28
- return true if minor > req_minor
29
-
30
- patch >= req_patch
31
- end
32
-
33
- end
34
- end
35
- end
36
- end
data/lib/vcr/version.rbc DELETED
@@ -1,572 +0,0 @@
1
- !RBIX
2
- 0
3
- x
4
- M
5
- 1
6
- n
7
- n
8
- x
9
- 10
10
- __script__
11
- i
12
- 28
13
- 99
14
- 7
15
- 0
16
- 65
17
- 49
18
- 1
19
- 2
20
- 13
21
- 99
22
- 12
23
- 7
24
- 2
25
- 12
26
- 7
27
- 3
28
- 12
29
- 65
30
- 12
31
- 49
32
- 4
33
- 4
34
- 15
35
- 49
36
- 2
37
- 0
38
- 15
39
- 2
40
- 11
41
- I
42
- 6
43
- I
44
- 0
45
- I
46
- 0
47
- I
48
- 0
49
- n
50
- p
51
- 5
52
- x
53
- 3
54
- VCR
55
- x
56
- 11
57
- open_module
58
- x
59
- 15
60
- __module_init__
61
- M
62
- 1
63
- n
64
- n
65
- x
66
- 3
67
- VCR
68
- i
69
- 23
70
- 5
71
- 66
72
- 5
73
- 5
74
- 47
75
- 49
76
- 0
77
- 1
78
- 15
79
- 99
80
- 7
81
- 1
82
- 7
83
- 2
84
- 65
85
- 67
86
- 49
87
- 3
88
- 0
89
- 49
90
- 4
91
- 4
92
- 11
93
- I
94
- 5
95
- I
96
- 0
97
- I
98
- 0
99
- I
100
- 0
101
- n
102
- p
103
- 5
104
- x
105
- 6
106
- extend
107
- x
108
- 7
109
- version
110
- M
111
- 1
112
- n
113
- n
114
- x
115
- 7
116
- version
117
- i
118
- 74
119
- 39
120
- 0
121
- 13
122
- 10
123
- 73
124
- 15
125
- 79
126
- 78
127
- 4
128
- 3
129
- 35
130
- 3
131
- 7
132
- 1
133
- 64
134
- 49
135
- 2
136
- 1
137
- 19
138
- 0
139
- 15
140
- 99
141
- 7
142
- 3
143
- 7
144
- 4
145
- 65
146
- 20
147
- 0
148
- 49
149
- 5
150
- 4
151
- 15
152
- 99
153
- 7
154
- 6
155
- 7
156
- 7
157
- 65
158
- 20
159
- 0
160
- 49
161
- 5
162
- 4
163
- 15
164
- 99
165
- 7
166
- 8
167
- 7
168
- 9
169
- 65
170
- 20
171
- 0
172
- 49
173
- 5
174
- 4
175
- 15
176
- 99
177
- 7
178
- 10
179
- 7
180
- 11
181
- 65
182
- 20
183
- 0
184
- 49
185
- 5
186
- 4
187
- 15
188
- 20
189
- 0
190
- 38
191
- 0
192
- 11
193
- I
194
- 6
195
- I
196
- 1
197
- I
198
- 0
199
- I
200
- 0
201
- n
202
- p
203
- 12
204
- x
205
- 8
206
- @version
207
- s
208
- 1
209
- .
210
- x
211
- 4
212
- join
213
- x
214
- 5
215
- parts
216
- M
217
- 1
218
- n
219
- n
220
- x
221
- 5
222
- parts
223
- i
224
- 18
225
- 45
226
- 0
227
- 1
228
- 49
229
- 2
230
- 0
231
- 7
232
- 3
233
- 64
234
- 49
235
- 4
236
- 1
237
- 56
238
- 5
239
- 50
240
- 6
241
- 0
242
- 11
243
- I
244
- 2
245
- I
246
- 0
247
- I
248
- 0
249
- I
250
- 0
251
- n
252
- p
253
- 7
254
- x
255
- 3
256
- VCR
257
- n
258
- x
259
- 7
260
- version
261
- s
262
- 1
263
- .
264
- x
265
- 5
266
- split
267
- M
268
- 1
269
- p
270
- 2
271
- x
272
- 9
273
- for_block
274
- t
275
- n
276
- x
277
- 5
278
- parts
279
- i
280
- 10
281
- 57
282
- 19
283
- 0
284
- 15
285
- 20
286
- 0
287
- 49
288
- 0
289
- 0
290
- 11
291
- I
292
- 3
293
- I
294
- 1
295
- I
296
- 1
297
- I
298
- 1
299
- n
300
- p
301
- 1
302
- x
303
- 4
304
- to_i
305
- p
306
- 3
307
- I
308
- 0
309
- I
310
- 8
311
- I
312
- a
313
- x
314
- 43
315
- /Users/mmarston/code/vcr/lib/vcr/version.rb
316
- p
317
- 1
318
- x
319
- 1
320
- p
321
- x
322
- 3
323
- map
324
- p
325
- 3
326
- I
327
- 0
328
- I
329
- 8
330
- I
331
- 12
332
- x
333
- 43
334
- /Users/mmarston/code/vcr/lib/vcr/version.rb
335
- p
336
- 0
337
- x
338
- 13
339
- attach_method
340
- x
341
- 5
342
- major
343
- M
344
- 1
345
- n
346
- n
347
- x
348
- 5
349
- major
350
- i
351
- 8
352
- 5
353
- 48
354
- 0
355
- 78
356
- 49
357
- 1
358
- 1
359
- 11
360
- I
361
- 2
362
- I
363
- 0
364
- I
365
- 0
366
- I
367
- 0
368
- n
369
- p
370
- 2
371
- x
372
- 5
373
- parts
374
- x
375
- 2
376
- []
377
- p
378
- 3
379
- I
380
- 0
381
- I
382
- 9
383
- I
384
- 8
385
- x
386
- 43
387
- /Users/mmarston/code/vcr/lib/vcr/version.rb
388
- p
389
- 0
390
- x
391
- 5
392
- minor
393
- M
394
- 1
395
- n
396
- n
397
- x
398
- 5
399
- minor
400
- i
401
- 8
402
- 5
403
- 48
404
- 0
405
- 79
406
- 49
407
- 1
408
- 1
409
- 11
410
- I
411
- 2
412
- I
413
- 0
414
- I
415
- 0
416
- I
417
- 0
418
- n
419
- p
420
- 2
421
- x
422
- 5
423
- parts
424
- x
425
- 2
426
- []
427
- p
428
- 3
429
- I
430
- 0
431
- I
432
- a
433
- I
434
- 8
435
- x
436
- 43
437
- /Users/mmarston/code/vcr/lib/vcr/version.rb
438
- p
439
- 0
440
- x
441
- 5
442
- patch
443
- M
444
- 1
445
- n
446
- n
447
- x
448
- 5
449
- patch
450
- i
451
- 8
452
- 5
453
- 48
454
- 0
455
- 80
456
- 49
457
- 1
458
- 1
459
- 11
460
- I
461
- 2
462
- I
463
- 0
464
- I
465
- 0
466
- I
467
- 0
468
- n
469
- p
470
- 2
471
- x
472
- 5
473
- parts
474
- x
475
- 2
476
- []
477
- p
478
- 3
479
- I
480
- 0
481
- I
482
- b
483
- I
484
- 8
485
- x
486
- 43
487
- /Users/mmarston/code/vcr/lib/vcr/version.rb
488
- p
489
- 0
490
- p
491
- 17
492
- I
493
- 0
494
- I
495
- 4
496
- I
497
- 0
498
- I
499
- e
500
- I
501
- 6
502
- I
503
- 6
504
- I
505
- 15
506
- I
507
- 8
508
- I
509
- 21
510
- I
511
- 9
512
- I
513
- 2d
514
- I
515
- a
516
- I
517
- 39
518
- I
519
- b
520
- I
521
- 45
522
- I
523
- d
524
- I
525
- 4a
526
- x
527
- 43
528
- /Users/mmarston/code/vcr/lib/vcr/version.rb
529
- p
530
- 1
531
- x
532
- 6
533
- string
534
- x
535
- 17
536
- method_visibility
537
- x
538
- 15
539
- add_defn_method
540
- p
541
- 5
542
- I
543
- 2
544
- I
545
- 2
546
- I
547
- 9
548
- I
549
- 4
550
- I
551
- 17
552
- x
553
- 43
554
- /Users/mmarston/code/vcr/lib/vcr/version.rb
555
- p
556
- 0
557
- x
558
- 13
559
- attach_method
560
- p
561
- 3
562
- I
563
- 0
564
- I
565
- 1
566
- I
567
- 1c
568
- x
569
- 43
570
- /Users/mmarston/code/vcr/lib/vcr/version.rb
571
- p
572
- 0