vcr 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/CHANGELOG.md +14 -2
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +20 -2
  4. data/README.md +6 -1
  5. data/Rakefile +6 -44
  6. data/benchmarks/http_stubbing_libraries.rb +4 -4
  7. data/cucumber.yml +14 -0
  8. data/features/README.md +21 -0
  9. data/features/cassettes/automatic_re_recording.feature +68 -0
  10. data/features/cassettes/dynamic_erb.feature +90 -0
  11. data/features/cassettes/format.feature +81 -0
  12. data/features/cassettes/no_cassette.feature +38 -0
  13. data/features/cassettes/record_modes/all.feature +78 -0
  14. data/features/cassettes/record_modes/new_episodes.feature +71 -0
  15. data/features/cassettes/record_modes/none.feature +65 -0
  16. data/features/cassettes/request_matching.feature +379 -0
  17. data/features/configuration/cassette_library_dir.feature +28 -0
  18. data/features/configuration/default_cassette_options.feature +80 -0
  19. data/features/configuration/ignore_localhost.feature +103 -0
  20. data/features/configuration/stub_with.feature +164 -0
  21. data/features/http_libraries/net_http.feature +137 -0
  22. data/features/step_definitions/cli_steps.rb +82 -0
  23. data/features/support/aruba_workaround/aruba_patches.rb +36 -0
  24. data/features/support/aruba_workaround/background_process.rb +4 -0
  25. data/features/support/env.rb +16 -102
  26. data/features/support/http_lib_filters.rb +37 -0
  27. data/features/support/vcr_cucumber_helpers.rb +34 -0
  28. data/features/test_frameworks/cucumber.feature +109 -0
  29. data/features/test_frameworks/rspec.feature +110 -0
  30. data/features/test_frameworks/shoulda.feature +64 -0
  31. data/features/test_frameworks/test_unit.feature +46 -0
  32. data/lib/vcr/cassette.rb +1 -1
  33. data/lib/vcr/structs.rb +64 -13
  34. data/lib/vcr/version.rb +1 -1
  35. data/{FullBuildRakeFile → script/FullBuildRakeFile} +0 -0
  36. data/script/full_build +1 -0
  37. data/spec/extensions/net_http_spec.rb +1 -1
  38. data/spec/spec_helper.rb +1 -1
  39. data/spec/structs_spec.rb +47 -16
  40. data/spec/support/vcr_localhost_server.rb +11 -5
  41. data/vcr.gemspec +2 -1
  42. metadata +82 -77
  43. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/regex_cassette.yml +0 -43
  44. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette1.yml +0 -43
  45. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette2.yml +0 -63
  46. data/features/fixtures/vcr_cassettes/1.9.1/cucumber_tags/replay_cassette3.yml +0 -85
  47. data/features/fixtures/vcr_cassettes/1.9.1/erb_cassette.yml +0 -36
  48. data/features/fixtures/vcr_cassettes/1.9.1/match_requests_on.yml +0 -35
  49. data/features/fixtures/vcr_cassettes/1.9.1/nested_replay_cassette.yml +0 -32
  50. data/features/fixtures/vcr_cassettes/1.9.1/not_the_real_response.yml +0 -43
  51. data/features/fixtures/vcr_cassettes/1.9.1/record_all.yml +0 -62
  52. data/features/fixtures/vcr_cassettes/1.9.1/replay_localhost_cassette.yml +0 -32
  53. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/regex_cassette.yml +0 -43
  54. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette1.yml +0 -43
  55. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette2.yml +0 -47
  56. data/features/fixtures/vcr_cassettes/not_1.9.1/cucumber_tags/replay_cassette3.yml +0 -85
  57. data/features/fixtures/vcr_cassettes/not_1.9.1/erb_cassette.yml +0 -36
  58. data/features/fixtures/vcr_cassettes/not_1.9.1/match_requests_on.yml +0 -35
  59. data/features/fixtures/vcr_cassettes/not_1.9.1/nested_replay_cassette.yml +0 -24
  60. data/features/fixtures/vcr_cassettes/not_1.9.1/not_the_real_response.yml +0 -43
  61. data/features/fixtures/vcr_cassettes/not_1.9.1/record_all.yml +0 -61
  62. data/features/fixtures/vcr_cassettes/not_1.9.1/replay_localhost_cassette.yml +0 -32
  63. data/features/http_client.feature +0 -16
  64. data/features/net_http.feature +0 -38
  65. data/features/record_response.feature +0 -95
  66. data/features/replay_recorded_response.feature +0 -96
  67. data/features/rspec.feature +0 -100
  68. data/features/step_definitions/http_client_steps.rb +0 -7
  69. data/features/step_definitions/net_http_steps.rb +0 -49
  70. data/features/step_definitions/vcr_steps.rb +0 -252
  71. data/features/webmock.feature +0 -26
  72. data/full_build +0 -1
@@ -1,32 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- :request: !ruby/struct:VCR::Request
4
- :method: :get
5
- :uri: http://localhost/
6
- :body:
7
- :headers:
8
- :response: !ruby/struct:VCR::Response
9
- :status: !ruby/struct:VCR::ResponseStatus
10
- :code: 200
11
- :message: OK
12
- :headers:
13
- etag:
14
- - "\"24ec5-1b6-4059a80bfd280\""
15
- last-modified:
16
- - Tue, 15 Nov 2005 13:24:10 GMT
17
- connection:
18
- - Keep-Alive
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:22:32 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2643"
29
- accept-ranges:
30
- - bytes
31
- :body: This is a fake response.
32
- :http_version: "1.1"
@@ -1,43 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: !ruby/regexp /example\.com\/reg/
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- etag:
14
- - "\"24ec5-1b6-4059a80bfd280\""
15
- last-modified:
16
- - Tue, 15 Nov 2005 13:24:10 GMT
17
- connection:
18
- - Keep-Alive
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:22:32 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2643"
29
- accept-ranges:
30
- - bytes
31
- body: |
32
- <HTML>
33
- <HEAD>
34
- <TITLE>Example Web Page</TITLE>
35
- </HEAD>
36
- <body>
37
- <p>
38
- This is the response from the regex cassette
39
- </p>
40
- </BODY>
41
- </HTML>
42
-
43
- http_version: "1.1"
@@ -1,43 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- last-modified:
14
- - Tue, 15 Nov 2005 13:24:10 GMT
15
- connection:
16
- - Keep-Alive
17
- etag:
18
- - "\"24ec5-1b6-4059a80bfd280\""
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:22:32 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2643"
29
- accept-ranges:
30
- - bytes
31
- body: |
32
- <HTML>
33
- <HEAD>
34
- <TITLE>Example Web Page</TITLE>
35
- </HEAD>
36
- <body>
37
- <p>
38
- This is not the real response from example.com
39
- </p>
40
- </BODY>
41
- </HTML>
42
-
43
- http_version: "1.1"
@@ -1,47 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/before_nested
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 404
11
- message: Not Found
12
- headers:
13
- connection:
14
- - close
15
- content-type:
16
- - text/html; charset=iso-8859-1
17
- date:
18
- - Thu, 25 Feb 2010 15:23:39 GMT
19
- server:
20
- - Apache/2.2.3 (CentOS)
21
- content-length:
22
- - "287"
23
- body: The before_nested response
24
- http_version: "1.1"
25
- - !ruby/struct:VCR::HTTPInteraction
26
- request: !ruby/struct:VCR::Request
27
- method: :get
28
- uri: http://example.com:80/after_nested
29
- body:
30
- headers:
31
- response: !ruby/struct:VCR::Response
32
- status: !ruby/struct:VCR::ResponseStatus
33
- code: 404
34
- message: Not Found
35
- headers:
36
- connection:
37
- - close
38
- content-type:
39
- - text/html; charset=iso-8859-1
40
- date:
41
- - Thu, 25 Feb 2010 15:23:39 GMT
42
- server:
43
- - Apache/2.2.3 (CentOS)
44
- content-length:
45
- - "286"
46
- body: The after_nested response
47
- http_version: "1.1"
@@ -1,85 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- last-modified:
14
- - Tue, 15 Nov 2005 13:24:10 GMT
15
- connection:
16
- - Keep-Alive
17
- etag:
18
- - "\"24ec5-1b6-4059a80bfd280\""
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:22:32 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2643"
29
- accept-ranges:
30
- - bytes
31
- body: |
32
- <HTML>
33
- <HEAD>
34
- <TITLE>Example Web Page</TITLE>
35
- </HEAD>
36
- <body>
37
- <p>
38
- This is not the real response from example.com
39
- </p>
40
- </BODY>
41
- </HTML>
42
-
43
- http_version: "1.1"
44
- - !ruby/struct:VCR::HTTPInteraction
45
- request: !ruby/struct:VCR::Request
46
- method: :get
47
- uri: http://example.com:80/
48
- body:
49
- headers:
50
- response: !ruby/struct:VCR::Response
51
- status: !ruby/struct:VCR::ResponseStatus
52
- code: 200
53
- message: OK
54
- headers:
55
- last-modified:
56
- - Tue, 15 Nov 2005 13:24:10 GMT
57
- connection:
58
- - Keep-Alive
59
- etag:
60
- - "\"24ec5-1b6-4059a80bfd280\""
61
- content-type:
62
- - text/html; charset=UTF-8
63
- date:
64
- - Thu, 25 Feb 2010 15:22:32 GMT
65
- server:
66
- - Apache/2.2.3 (CentOS)
67
- content-length:
68
- - "438"
69
- age:
70
- - "2643"
71
- accept-ranges:
72
- - bytes
73
- body: |
74
- <HTML>
75
- <HEAD>
76
- <TITLE>Example Web Page</TITLE>
77
- </HEAD>
78
- <body>
79
- <p>
80
- This is another fake response from example.com
81
- </p>
82
- </BODY>
83
- </HTML>
84
-
85
- http_version: "1.1"
@@ -1,36 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/embedded_ruby_code
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- etag:
14
- - "\"24ec5-1b6-4059a80bfd280\""
15
- last-modified:
16
- - Tue, 15 Nov 2005 13:24:10 GMT
17
- connection:
18
- - Keep-Alive
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:20:47 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2546"
29
- accept-ranges:
30
- - bytes
31
- body: |
32
- Some embedded ruby code: <%= 4 + 3 %>
33
- The value of some_variable is: <%= some_variable %>
34
-
35
- http_version: "1.1"
36
-
@@ -1,35 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :post
5
- uri: http://example.com:80/
6
- body: foo=bar
7
- headers:
8
- x-http-user:
9
- - bob
10
- response: !ruby/struct:VCR::Response
11
- status: !ruby/struct:VCR::ResponseStatus
12
- code: 200
13
- message: OK
14
- headers:
15
- etag:
16
- - "\"24ec5-1b6-4059a80bfd280\""
17
- body: foo=bar response | bob response
18
- http_version: "1.1"
19
- - !ruby/struct:VCR::HTTPInteraction
20
- request: !ruby/struct:VCR::Request
21
- method: :post
22
- uri: http://example.com:80/
23
- body: bar=bazz
24
- headers:
25
- x-http-user:
26
- - joe
27
- response: !ruby/struct:VCR::Response
28
- status: !ruby/struct:VCR::ResponseStatus
29
- code: 200
30
- message: OK
31
- headers:
32
- etag:
33
- - "\"24ec5-1b6-4059a80bfd280\""
34
- body: bar=bazz response | joe response
35
- http_version: "1.1"
@@ -1,24 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/nested
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 404
11
- message: Not Found
12
- headers:
13
- connection:
14
- - close
15
- content-type:
16
- - text/html; charset=iso-8859-1
17
- date:
18
- - Thu, 25 Feb 2010 15:19:40 GMT
19
- server:
20
- - Apache/2.2.3 (CentOS)
21
- content-length:
22
- - "280"
23
- body: The nested response
24
- http_version: "1.1"
@@ -1,43 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- last-modified:
14
- - Tue, 15 Nov 2005 13:24:10 GMT
15
- connection:
16
- - Keep-Alive
17
- etag:
18
- - "\"24ec5-1b6-4059a80bfd280\""
19
- content-type:
20
- - text/html; charset=UTF-8
21
- date:
22
- - Thu, 25 Feb 2010 15:20:47 GMT
23
- server:
24
- - Apache/2.2.3 (CentOS)
25
- content-length:
26
- - "438"
27
- age:
28
- - "2546"
29
- accept-ranges:
30
- - bytes
31
- body: |
32
- <HTML>
33
- <HEAD>
34
- <TITLE>Example Web Page</TITLE>
35
- </HEAD>
36
- <body>
37
- <p>
38
- This is not the real response from example.com
39
- </p>
40
- </BODY>
41
- </HTML>
42
-
43
- http_version: "1.1"
@@ -1,61 +0,0 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: http://example.com:80/a
6
- body:
7
- headers:
8
- response: !ruby/struct:VCR::Response
9
- status: !ruby/struct:VCR::ResponseStatus
10
- code: 200
11
- message: OK
12
- headers:
13
- etag:
14
- - "\"24ec5-1b6-4059a80bfd280\""
15
- body: a response 1
16
- http_version: "1.1"
17
- - !ruby/struct:VCR::HTTPInteraction
18
- request: !ruby/struct:VCR::Request
19
- method: :get
20
- uri: http://example.com:80/a
21
- body:
22
- headers:
23
- response: !ruby/struct:VCR::Response
24
- status: !ruby/struct:VCR::ResponseStatus
25
- code: 200
26
- message: OK
27
- headers:
28
- etag:
29
- - "\"24ec5-1b6-4059a80bfd280\""
30
- body: a response 2
31
- http_version: "1.1"
32
- - !ruby/struct:VCR::HTTPInteraction
33
- request: !ruby/struct:VCR::Request
34
- method: :get
35
- uri: http://example.com:80/b
36
- body:
37
- headers:
38
- response: !ruby/struct:VCR::Response
39
- status: !ruby/struct:VCR::ResponseStatus
40
- code: 200
41
- message: OK
42
- headers:
43
- etag:
44
- - "\"24ec5-1b6-4059a80bfd280\""
45
- body: b response 1
46
- http_version: "1.1"
47
- - !ruby/struct:VCR::HTTPInteraction
48
- request: !ruby/struct:VCR::Request
49
- method: :get
50
- uri: http://example.com:80/b
51
- body:
52
- headers:
53
- response: !ruby/struct:VCR::Response
54
- status: !ruby/struct:VCR::ResponseStatus
55
- code: 200
56
- message: OK
57
- headers:
58
- etag:
59
- - "\"24ec5-1b6-4059a80bfd280\""
60
- body: b response 2
61
- http_version: "1.1"