minitest-vcr 1.0.0 → 1.0.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.
- checksums.yaml +4 -4
- data/lib/minitest-vcr/spec.rb +8 -0
- data/lib/minitest-vcr/version.rb +1 -1
- data/test/cassettes/MinitestVcr_Spec/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml +10 -10
- data/test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml +64 -0
- data/test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml +10 -10
- data/test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml +64 -0
- data/test/minitest-vcr/metadata_test.rb +28 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286e84e0f3502ebc84ff252619954f0bb6057365
|
4
|
+
data.tar.gz: c5e00e8a4ebe4189143de8ee161f3c424f1228dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 580bcee0d8f3ff86125f005a3a17340585aa90358d7e07a7a6328eb3bfd658564bc4d507fa664abc50074fcc8118a4902939eea6123cc4702ffccd96d8fbb4bf
|
7
|
+
data.tar.gz: bc2029f316c756a81362f3ecafe380aff58bba2a84ad31f1e59563e9981500712796acc44c5b8d81bf7111be6ec8bdb232a32977fed1a9f6e53f1c722b2df0da
|
data/lib/minitest-vcr/spec.rb
CHANGED
@@ -25,7 +25,11 @@ module MinitestVcr
|
|
25
25
|
module StringHelpers
|
26
26
|
|
27
27
|
def self.vcr_path(example_class_name, example, spec_name)
|
28
|
+
# TODO Refactor! To tired but this is wack.
|
29
|
+
@path = nil
|
30
|
+
|
28
31
|
example_class_name.scan(/^(.*?)::[#a-z]/) do |class_names|
|
32
|
+
|
29
33
|
class_name = class_names.flatten.first
|
30
34
|
|
31
35
|
if class_name.nil?
|
@@ -35,6 +39,10 @@ module MinitestVcr
|
|
35
39
|
end
|
36
40
|
end
|
37
41
|
|
42
|
+
if @path.nil?
|
43
|
+
@path = prep example.class.name
|
44
|
+
end
|
45
|
+
|
38
46
|
@path.push(spec_name).join("/") unless @path.nil?
|
39
47
|
end
|
40
48
|
|
data/lib/minitest-vcr/version.rb
CHANGED
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.
|
11
|
+
- Faraday v0.9.0
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -25,15 +25,15 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Fri, 10 Oct 2014 06:26:07 GMT
|
29
29
|
Etag:
|
30
|
-
-
|
30
|
+
- '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 17 Oct 2014 06:26:07 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (rhv/818F)
|
37
37
|
X-Cache:
|
38
38
|
- HIT
|
39
39
|
X-Ec-Custom-Error:
|
@@ -41,8 +41,8 @@ http_interactions:
|
|
41
41
|
Content-Length:
|
42
42
|
- '1270'
|
43
43
|
body:
|
44
|
-
encoding:
|
45
|
-
string:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
46
46
|
\ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
|
47
47
|
charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
|
48
48
|
initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
|
@@ -60,5 +60,5 @@ http_interactions:
|
|
60
60
|
or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
|
61
61
|
information...</a></p>\n</div>\n</body>\n</html>\n"
|
62
62
|
http_version:
|
63
|
-
recorded_at:
|
64
|
-
recorded_with: VCR 2.
|
63
|
+
recorded_at: Fri, 10 Oct 2014 06:26:07 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://example.com/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Accept-Ranges:
|
22
|
+
- bytes
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=604800
|
25
|
+
Content-Type:
|
26
|
+
- text/html
|
27
|
+
Date:
|
28
|
+
- Fri, 10 Oct 2014 06:26:50 GMT
|
29
|
+
Etag:
|
30
|
+
- '"359670651"'
|
31
|
+
Expires:
|
32
|
+
- Fri, 17 Oct 2014 06:26:50 GMT
|
33
|
+
Last-Modified:
|
34
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
|
+
Server:
|
36
|
+
- ECS (rhv/818F)
|
37
|
+
X-Cache:
|
38
|
+
- HIT
|
39
|
+
X-Ec-Custom-Error:
|
40
|
+
- '1'
|
41
|
+
Content-Length:
|
42
|
+
- '1270'
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
46
|
+
\ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
|
47
|
+
charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
|
48
|
+
initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
|
49
|
+
#f0f0f2;\n margin: 0;\n padding: 0;\n font-family: \"Open
|
50
|
+
Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n
|
51
|
+
\ div {\n width: 600px;\n margin: 5em auto;\n padding:
|
52
|
+
50px;\n background-color: #fff;\n border-radius: 1em;\n }\n
|
53
|
+
\ a:link, a:visited {\n color: #38488f;\n text-decoration:
|
54
|
+
none;\n }\n @media (max-width: 700px) {\n body {\n background-color:
|
55
|
+
#fff;\n }\n div {\n width: auto;\n margin:
|
56
|
+
0 auto;\n border-radius: 0;\n padding: 1em;\n }\n
|
57
|
+
\ }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n
|
58
|
+
\ <p>This domain is established to be used for illustrative examples in
|
59
|
+
documents. You may use this\n domain in examples without prior coordination
|
60
|
+
or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
|
61
|
+
information...</a></p>\n</div>\n</body>\n</html>\n"
|
62
|
+
http_version:
|
63
|
+
recorded_at: Fri, 10 Oct 2014 06:26:50 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Faraday v0.
|
11
|
+
- Faraday v0.9.0
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -25,15 +25,15 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Fri, 10 Oct 2014 06:26:07 GMT
|
29
29
|
Etag:
|
30
|
-
-
|
30
|
+
- '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 17 Oct 2014 06:26:07 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (rhv/818F)
|
37
37
|
X-Cache:
|
38
38
|
- HIT
|
39
39
|
X-Ec-Custom-Error:
|
@@ -41,8 +41,8 @@ http_interactions:
|
|
41
41
|
Content-Length:
|
42
42
|
- '1270'
|
43
43
|
body:
|
44
|
-
encoding:
|
45
|
-
string:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
46
46
|
\ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
|
47
47
|
charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
|
48
48
|
initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
|
@@ -60,5 +60,5 @@ http_interactions:
|
|
60
60
|
or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
|
61
61
|
information...</a></p>\n</div>\n</body>\n</html>\n"
|
62
62
|
http_version:
|
63
|
-
recorded_at:
|
64
|
-
recorded_with: VCR 2.
|
63
|
+
recorded_at: Fri, 10 Oct 2014 06:26:07 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,64 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://example.com/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- "*/*"
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Accept-Ranges:
|
22
|
+
- bytes
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=604800
|
25
|
+
Content-Type:
|
26
|
+
- text/html
|
27
|
+
Date:
|
28
|
+
- Fri, 10 Oct 2014 06:26:07 GMT
|
29
|
+
Etag:
|
30
|
+
- '"359670651"'
|
31
|
+
Expires:
|
32
|
+
- Fri, 17 Oct 2014 06:26:07 GMT
|
33
|
+
Last-Modified:
|
34
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
|
+
Server:
|
36
|
+
- ECS (rhv/818F)
|
37
|
+
X-Cache:
|
38
|
+
- HIT
|
39
|
+
X-Ec-Custom-Error:
|
40
|
+
- '1'
|
41
|
+
Content-Length:
|
42
|
+
- '1270'
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
46
|
+
\ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
|
47
|
+
charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
|
48
|
+
initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
|
49
|
+
#f0f0f2;\n margin: 0;\n padding: 0;\n font-family: \"Open
|
50
|
+
Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n
|
51
|
+
\ div {\n width: 600px;\n margin: 5em auto;\n padding:
|
52
|
+
50px;\n background-color: #fff;\n border-radius: 1em;\n }\n
|
53
|
+
\ a:link, a:visited {\n color: #38488f;\n text-decoration:
|
54
|
+
none;\n }\n @media (max-width: 700px) {\n body {\n background-color:
|
55
|
+
#fff;\n }\n div {\n width: auto;\n margin:
|
56
|
+
0 auto;\n border-radius: 0;\n padding: 1em;\n }\n
|
57
|
+
\ }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n
|
58
|
+
\ <p>This domain is established to be used for illustrative examples in
|
59
|
+
documents. You may use this\n domain in examples without prior coordination
|
60
|
+
or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
|
61
|
+
information...</a></p>\n</div>\n</body>\n</html>\n"
|
62
|
+
http_version:
|
63
|
+
recorded_at: Fri, 10 Oct 2014 06:26:07 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
MinitestVcr::Spec.configure!
|
4
|
+
|
5
|
+
|
6
|
+
describe "with tag metadata", :vcr => {:tag => :bd_finditem} do
|
7
|
+
|
8
|
+
before do
|
9
|
+
conn = Faraday.new
|
10
|
+
@response = conn.get 'http://example.com'
|
11
|
+
end
|
12
|
+
|
13
|
+
it "uses appropraite cassette name" do
|
14
|
+
|
15
|
+
assert ! VCR.current_cassette.nil?, "No current cassette"
|
16
|
+
|
17
|
+
assert ! VCR.current_cassette.name.nil?, "No current cassette name"
|
18
|
+
|
19
|
+
|
20
|
+
if VCR.current_cassette.name
|
21
|
+
(VCR.current_cassette.name.split('/')).must_equal([
|
22
|
+
'with tag metadata',
|
23
|
+
'uses appropraite cassette name'
|
24
|
+
])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-vcr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Piccolo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vcr
|
@@ -169,8 +169,11 @@ files:
|
|
169
169
|
- lib/minitest-vcr/version.rb
|
170
170
|
- minitest-vcr.gemspec
|
171
171
|
- test/cassettes/MinitestVcr_Spec/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
172
|
+
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml
|
172
173
|
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
174
|
+
- test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
|
173
175
|
- test/helper.rb
|
176
|
+
- test/minitest-vcr/metadata_test.rb
|
174
177
|
- test/minitest-vcr/spec_test.rb
|
175
178
|
homepage: ''
|
176
179
|
licenses:
|
@@ -198,7 +201,9 @@ specification_version: 4
|
|
198
201
|
summary: Allows VCR to automatically make cassetes with proper file paths with MiniTest
|
199
202
|
test_files:
|
200
203
|
- test/cassettes/MinitestVcr_Spec/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
204
|
+
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml
|
201
205
|
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
206
|
+
- test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
|
202
207
|
- test/helper.rb
|
208
|
+
- test/minitest-vcr/metadata_test.rb
|
203
209
|
- test/minitest-vcr/spec_test.rb
|
204
|
-
has_rdoc:
|