minitest-vcr 1.2.1 → 1.2.2
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 +24 -5
- data/lib/minitest-vcr/version.rb +1 -1
- data/test/cassettes/{MinitestVcr/Spec → MinitestVcr_Spec}/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml +8 -8
- data/test/cassettes/{MinitestVcr/Spec → MinitestVcr_Spec}/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml +8 -8
- data/test/cassettes/{MinitestVcr/Spec → MinitestVcr_Spec}/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml +8 -8
- data/test/cassettes/{MinitestVcr/Spec → MinitestVcr_Spec}/nested_describe/example_in_nested_describe.yml +8 -8
- data/test/cassettes/{MinitestVcr/Spec → MinitestVcr_Spec}/top_level_example.yml +8 -8
- data/test/cassettes/Some_Crazy_Nested_RandomClass/nested_describe/example_in_nested_describe.yml +64 -0
- data/test/cassettes/Some_Crazy_Nested_RandomClass/top_level_example.yml +64 -0
- data/test/cassettes/top_level_describe/an_inner_describe/a_test_inside_inner_describe.yml +64 -0
- data/test/minitest-vcr/deeply_namespaced_class_as_description_test.rb +30 -0
- data/test/minitest-vcr/nested_describe_test.rb +17 -2
- data/test/minitest-vcr/spec_test.rb +2 -4
- metadata +20 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fecb5137f3c4e0d76d6d214f9d279afca97cbd7
|
4
|
+
data.tar.gz: 46b395d691df45a268370bb1c3b9cc3a44c9af2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bb18a46f12c7aadb3b068831d9bcc82b42c1c956416407bb4b97ba82cc95b6e5a2a88f64c13b213fbc3c0883e3a4827b84cb200a6d670af9fb54b958a84541c
|
7
|
+
data.tar.gz: ecafc8b9d6698fd04aaf9a5aa16e3812e183681efedf642b3fb67ac5d73e1b42ff4f087f9b3b275491f9177cc5d771361a1807f9188f25a60cd3d84fd280c76a
|
data/lib/minitest-vcr/spec.rb
CHANGED
@@ -8,7 +8,7 @@ module MinitestVcr
|
|
8
8
|
run_before = lambda do |example|
|
9
9
|
if metadata[:vcr]
|
10
10
|
options = metadata[:vcr].is_a?(Hash) ? metadata[:vcr] : {}
|
11
|
-
VCR.insert_cassette StringHelpers.vcr_path(example
|
11
|
+
VCR.insert_cassette StringHelpers.vcr_path(example), options
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -24,14 +24,33 @@ module MinitestVcr
|
|
24
24
|
|
25
25
|
module StringHelpers
|
26
26
|
|
27
|
-
def self.vcr_path(
|
28
|
-
|
27
|
+
def self.vcr_path(example)
|
28
|
+
description_stack(example).push(extract_example_description(example)).join("/")
|
29
29
|
end
|
30
30
|
|
31
31
|
protected
|
32
32
|
|
33
|
-
def self.
|
34
|
-
|
33
|
+
def self.description_stack(example)
|
34
|
+
frame = example.class
|
35
|
+
stack = []
|
36
|
+
|
37
|
+
while frame != Minitest::Spec do
|
38
|
+
stack.unshift frame.desc.to_s
|
39
|
+
frame = frame.superclass
|
40
|
+
end
|
41
|
+
|
42
|
+
return stack
|
43
|
+
end
|
44
|
+
|
45
|
+
# Minitest::Spec takes the example description and writes
|
46
|
+
# a test_NNNN_ in front of it, and doesn't actually keep
|
47
|
+
# the original anywhere. Okay, we'll take it out.
|
48
|
+
def self.extract_example_description(example)
|
49
|
+
if (example.name =~ /\Atest_\d{4}_(.*)\z/)
|
50
|
+
return $1
|
51
|
+
else
|
52
|
+
return example.name
|
53
|
+
end
|
35
54
|
end
|
36
55
|
|
37
56
|
end
|
data/lib/minitest-vcr/version.rb
CHANGED
@@ -12,7 +12,7 @@ http_interactions:
|
|
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, 17 Oct 2014 05:41:47 GMT
|
29
29
|
Etag:
|
30
|
-
- '"359670651"'
|
30
|
+
- ! '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 24 Oct 2014 05:41:47 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (iad/182A)
|
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: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
encoding: US-ASCII
|
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:
|
63
|
+
recorded_at: Fri, 17 Oct 2014 05:41:47 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
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, 17 Oct 2014 13:21:14 GMT
|
29
29
|
Etag:
|
30
|
-
- '"359670651"'
|
30
|
+
- ! '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 24 Oct 2014 13:21:14 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (iad/182A)
|
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: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
encoding: US-ASCII
|
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:
|
63
|
+
recorded_at: Fri, 17 Oct 2014 13:21:14 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
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, 17 Oct 2014 05:41:47 GMT
|
29
29
|
Etag:
|
30
|
-
- '"359670651"'
|
30
|
+
- ! '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 24 Oct 2014 05:41:47 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (iad/182A)
|
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: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
encoding: US-ASCII
|
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:
|
63
|
+
recorded_at: Fri, 17 Oct 2014 05:41:47 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
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, 17 Oct 2014 05:41:47 GMT
|
29
29
|
Etag:
|
30
|
-
- '"359670651"'
|
30
|
+
- ! '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 24 Oct 2014 05:41:47 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (iad/182A)
|
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: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
encoding: US-ASCII
|
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:
|
63
|
+
recorded_at: Fri, 17 Oct 2014 05:41:47 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
@@ -12,7 +12,7 @@ http_interactions:
|
|
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, 17 Oct 2014 05:41:47 GMT
|
29
29
|
Etag:
|
30
|
-
- '"359670651"'
|
30
|
+
- ! '"359670651"'
|
31
31
|
Expires:
|
32
|
-
-
|
32
|
+
- Fri, 24 Oct 2014 05:41:47 GMT
|
33
33
|
Last-Modified:
|
34
34
|
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
35
|
Server:
|
36
|
-
- ECS (
|
36
|
+
- ECS (iad/182A)
|
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: "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
|
44
|
+
encoding: US-ASCII
|
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:
|
63
|
+
recorded_at: Fri, 17 Oct 2014 05:41:47 GMT
|
64
64
|
recorded_with: VCR 2.9.3
|
data/test/cassettes/Some_Crazy_Nested_RandomClass/nested_describe/example_in_nested_describe.yml
ADDED
@@ -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, 17 Oct 2014 13:21:14 GMT
|
29
|
+
Etag:
|
30
|
+
- ! '"359670651"'
|
31
|
+
Expires:
|
32
|
+
- Fri, 24 Oct 2014 13:21:14 GMT
|
33
|
+
Last-Modified:
|
34
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
|
+
Server:
|
36
|
+
- ECS (iad/182A)
|
37
|
+
X-Cache:
|
38
|
+
- HIT
|
39
|
+
X-Ec-Custom-Error:
|
40
|
+
- '1'
|
41
|
+
Content-Length:
|
42
|
+
- '1270'
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
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, 17 Oct 2014 13:21:14 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, 17 Oct 2014 13:21:14 GMT
|
29
|
+
Etag:
|
30
|
+
- ! '"359670651"'
|
31
|
+
Expires:
|
32
|
+
- Fri, 24 Oct 2014 13:21:14 GMT
|
33
|
+
Last-Modified:
|
34
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
|
+
Server:
|
36
|
+
- ECS (iad/182A)
|
37
|
+
X-Cache:
|
38
|
+
- HIT
|
39
|
+
X-Ec-Custom-Error:
|
40
|
+
- '1'
|
41
|
+
Content-Length:
|
42
|
+
- '1270'
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
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, 17 Oct 2014 13:21:14 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
|
+
- Mon, 20 Oct 2014 22:44:12 GMT
|
29
|
+
Etag:
|
30
|
+
- ! '"359670651"'
|
31
|
+
Expires:
|
32
|
+
- Mon, 27 Oct 2014 22:44:12 GMT
|
33
|
+
Last-Modified:
|
34
|
+
- Fri, 09 Aug 2013 23:54:35 GMT
|
35
|
+
Server:
|
36
|
+
- ECS (iad/182A)
|
37
|
+
X-Cache:
|
38
|
+
- HIT
|
39
|
+
X-Ec-Custom-Error:
|
40
|
+
- '1'
|
41
|
+
Content-Length:
|
42
|
+
- '1270'
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
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: Mon, 20 Oct 2014 22:44:12 GMT
|
64
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
module Some
|
4
|
+
module Crazy
|
5
|
+
module Nested
|
6
|
+
class RandomClass
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
MinitestVcr::Spec.configure!
|
13
|
+
|
14
|
+
describe Some::Crazy::Nested::RandomClass, :vcr do
|
15
|
+
before do
|
16
|
+
conn = Faraday.new
|
17
|
+
@response = conn.get "http://example.com"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "top level example" do
|
21
|
+
VCR.current_cassette.name.must_equal "Some::Crazy::Nested::RandomClass/top level example"
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "nested describe" do
|
25
|
+
it "example in nested describe" do
|
26
|
+
VCR.current_cassette.name.must_equal "Some::Crazy::Nested::RandomClass/nested describe/example in nested describe"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -9,13 +9,28 @@ describe MinitestVcr::Spec, :vcr => {:tag => :some_tag, :match_requests_on => [:
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "top level example" do
|
12
|
-
VCR.current_cassette.name.must_equal "MinitestVcr
|
12
|
+
VCR.current_cassette.name.must_equal "MinitestVcr::Spec/top level example"
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "nested describe" do
|
16
16
|
it "example in nested describe" do
|
17
|
-
VCR.current_cassette.name.must_equal "MinitestVcr
|
17
|
+
VCR.current_cassette.name.must_equal "MinitestVcr::Spec/nested describe/example in nested describe"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
22
|
+
|
23
|
+
|
24
|
+
describe "top level describe", :vcr do
|
25
|
+
describe "an inner describe" do
|
26
|
+
it "a test inside inner describe" do
|
27
|
+
conn = Faraday.new
|
28
|
+
@response = conn.get "http://example.com"
|
29
|
+
|
30
|
+
VCR.current_cassette.name.must_equal "top level describe/an inner describe/a test inside inner describe"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it "makes a request succesfully" do
|
35
|
+
end
|
36
|
+
end
|
@@ -12,8 +12,7 @@ describe MinitestVcr::Spec do
|
|
12
12
|
end
|
13
13
|
it 'uses a cassette for any examples' do
|
14
14
|
(VCR.current_cassette.name.split('/')).must_equal([
|
15
|
-
'MinitestVcr',
|
16
|
-
'Spec',
|
15
|
+
'MinitestVcr::Spec',
|
17
16
|
'a describe with metadata',
|
18
17
|
'with a nested example group',
|
19
18
|
'uses a cassette for any examples'
|
@@ -30,8 +29,7 @@ describe MinitestVcr::Spec do
|
|
30
29
|
end
|
31
30
|
it 'uses a cassette for any examples', :vcr do
|
32
31
|
(VCR.current_cassette.name.split('/')).must_equal([
|
33
|
-
'MinitestVcr',
|
34
|
-
'Spec',
|
32
|
+
'MinitestVcr::Spec',
|
35
33
|
'an it with metadata',
|
36
34
|
'with a nested example group',
|
37
35
|
'uses a cassette for any examples'
|
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.2.
|
4
|
+
version: 1.2.2
|
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-10-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vcr
|
@@ -168,13 +168,17 @@ files:
|
|
168
168
|
- lib/minitest-vcr/spec.rb
|
169
169
|
- lib/minitest-vcr/version.rb
|
170
170
|
- minitest-vcr.gemspec
|
171
|
-
- test/cassettes/
|
172
|
-
- test/cassettes/
|
173
|
-
- test/cassettes/
|
174
|
-
- test/cassettes/
|
175
|
-
- test/cassettes/
|
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
|
173
|
+
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
174
|
+
- test/cassettes/MinitestVcr_Spec/nested_describe/example_in_nested_describe.yml
|
175
|
+
- test/cassettes/MinitestVcr_Spec/top_level_example.yml
|
176
|
+
- test/cassettes/Some_Crazy_Nested_RandomClass/nested_describe/example_in_nested_describe.yml
|
177
|
+
- test/cassettes/Some_Crazy_Nested_RandomClass/top_level_example.yml
|
178
|
+
- test/cassettes/top_level_describe/an_inner_describe/a_test_inside_inner_describe.yml
|
176
179
|
- test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
|
177
180
|
- test/helper.rb
|
181
|
+
- test/minitest-vcr/deeply_namespaced_class_as_description_test.rb
|
178
182
|
- test/minitest-vcr/metadata_test.rb
|
179
183
|
- test/minitest-vcr/nested_describe_test.rb
|
180
184
|
- test/minitest-vcr/spec_test.rb
|
@@ -203,13 +207,17 @@ signing_key:
|
|
203
207
|
specification_version: 4
|
204
208
|
summary: Allows VCR to automatically make cassetes with proper file paths with MiniTest
|
205
209
|
test_files:
|
206
|
-
- test/cassettes/
|
207
|
-
- test/cassettes/
|
208
|
-
- test/cassettes/
|
209
|
-
- test/cassettes/
|
210
|
-
- test/cassettes/
|
210
|
+
- test/cassettes/MinitestVcr_Spec/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
211
|
+
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml
|
212
|
+
- test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
|
213
|
+
- test/cassettes/MinitestVcr_Spec/nested_describe/example_in_nested_describe.yml
|
214
|
+
- test/cassettes/MinitestVcr_Spec/top_level_example.yml
|
215
|
+
- test/cassettes/Some_Crazy_Nested_RandomClass/nested_describe/example_in_nested_describe.yml
|
216
|
+
- test/cassettes/Some_Crazy_Nested_RandomClass/top_level_example.yml
|
217
|
+
- test/cassettes/top_level_describe/an_inner_describe/a_test_inside_inner_describe.yml
|
211
218
|
- test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
|
212
219
|
- test/helper.rb
|
220
|
+
- test/minitest-vcr/deeply_namespaced_class_as_description_test.rb
|
213
221
|
- test/minitest-vcr/metadata_test.rb
|
214
222
|
- test/minitest-vcr/nested_describe_test.rb
|
215
223
|
- test/minitest-vcr/spec_test.rb
|