minitest-vcr 1.0.1 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 286e84e0f3502ebc84ff252619954f0bb6057365
4
- data.tar.gz: c5e00e8a4ebe4189143de8ee161f3c424f1228dd
3
+ metadata.gz: 8b06850137eab48444476587c1bd5cd51110a215
4
+ data.tar.gz: 54c82b75416e27952a059041ddec4d7a7321cf31
5
5
  SHA512:
6
- metadata.gz: 580bcee0d8f3ff86125f005a3a17340585aa90358d7e07a7a6328eb3bfd658564bc4d507fa664abc50074fcc8118a4902939eea6123cc4702ffccd96d8fbb4bf
7
- data.tar.gz: bc2029f316c756a81362f3ecafe380aff58bba2a84ad31f1e59563e9981500712796acc44c5b8d81bf7111be6ec8bdb232a32977fed1a9f6e53f1c722b2df0da
6
+ metadata.gz: 1aed1d4a8582769fe71d0c0d4d7f88aa842b5770c04fb27e157679ded9b2f3a60ce6dcb934b1ea4005ada8af41a3d48c778ef9c6f59a96a451a02ef9bd642497
7
+ data.tar.gz: 8ba08f1b1443ae56d46fa28f5d55c0ed952e3c8f29c1151e72462526a33b999c37801d0cd8877807a4c83ac0045cb2754b5c8f7e1847009ac0449812467a3705
@@ -28,20 +28,7 @@ module MinitestVcr
28
28
  # TODO Refactor! To tired but this is wack.
29
29
  @path = nil
30
30
 
31
- example_class_name.scan(/^(.*?)::[#a-z]/) do |class_names|
32
-
33
- class_name = class_names.flatten.first
34
-
35
- if class_name.nil?
36
- @path = prep example.class.name
37
- else
38
- @path = prep(example.class.name.gsub(class_name, "")).unshift(class_name)
39
- end
40
- end
41
-
42
- if @path.nil?
43
- @path = prep example.class.name
44
- end
31
+ @path = prep example.class.name
45
32
 
46
33
  @path.push(spec_name).join("/") unless @path.nil?
47
34
  end
@@ -1,3 +1,3 @@
1
1
  module MinitestVcr
2
- VERSION = "1.0.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -25,15 +25,15 @@ http_interactions:
25
25
  Content-Type:
26
26
  - text/html
27
27
  Date:
28
- - Fri, 10 Oct 2014 06:26:07 GMT
28
+ - Tue, 14 Oct 2014 18:04:12 GMT
29
29
  Etag:
30
30
  - '"359670651"'
31
31
  Expires:
32
- - Fri, 17 Oct 2014 06:26:07 GMT
32
+ - Tue, 21 Oct 2014 18:04:12 GMT
33
33
  Last-Modified:
34
34
  - Fri, 09 Aug 2013 23:54:35 GMT
35
35
  Server:
36
- - ECS (rhv/818F)
36
+ - ECS (ftw/FBE4)
37
37
  X-Cache:
38
38
  - HIT
39
39
  X-Ec-Custom-Error:
@@ -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: Fri, 10 Oct 2014 06:26:07 GMT
63
+ recorded_at: Tue, 14 Oct 2014 18:04:12 GMT
64
64
  recorded_with: VCR 2.9.3
@@ -25,15 +25,15 @@ http_interactions:
25
25
  Content-Type:
26
26
  - text/html
27
27
  Date:
28
- - Fri, 10 Oct 2014 06:26:50 GMT
28
+ - Tue, 14 Oct 2014 18:04:11 GMT
29
29
  Etag:
30
30
  - '"359670651"'
31
31
  Expires:
32
- - Fri, 17 Oct 2014 06:26:50 GMT
32
+ - Tue, 21 Oct 2014 18:04:11 GMT
33
33
  Last-Modified:
34
34
  - Fri, 09 Aug 2013 23:54:35 GMT
35
35
  Server:
36
- - ECS (rhv/818F)
36
+ - ECS (ftw/FBE4)
37
37
  X-Cache:
38
38
  - HIT
39
39
  X-Ec-Custom-Error:
@@ -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: Fri, 10 Oct 2014 06:26:50 GMT
63
+ recorded_at: Tue, 14 Oct 2014 18:04:11 GMT
64
64
  recorded_with: VCR 2.9.3
@@ -25,15 +25,15 @@ http_interactions:
25
25
  Content-Type:
26
26
  - text/html
27
27
  Date:
28
- - Fri, 10 Oct 2014 06:26:07 GMT
28
+ - Tue, 14 Oct 2014 18:04:11 GMT
29
29
  Etag:
30
30
  - '"359670651"'
31
31
  Expires:
32
- - Fri, 17 Oct 2014 06:26:07 GMT
32
+ - Tue, 21 Oct 2014 18:04:11 GMT
33
33
  Last-Modified:
34
34
  - Fri, 09 Aug 2013 23:54:35 GMT
35
35
  Server:
36
- - ECS (rhv/818F)
36
+ - ECS (ftw/FBE4)
37
37
  X-Cache:
38
38
  - HIT
39
39
  X-Ec-Custom-Error:
@@ -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: Fri, 10 Oct 2014 06:26:07 GMT
63
+ recorded_at: Tue, 14 Oct 2014 18:04:11 GMT
64
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
+ - Tue, 14 Oct 2014 18:04:11 GMT
29
+ Etag:
30
+ - '"359670651"'
31
+ Expires:
32
+ - Tue, 21 Oct 2014 18:04:11 GMT
33
+ Last-Modified:
34
+ - Fri, 09 Aug 2013 23:54:35 GMT
35
+ Server:
36
+ - ECS (ftw/FBE4)
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: Tue, 14 Oct 2014 18:04:11 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
+ - Tue, 14 Oct 2014 18:04:11 GMT
29
+ Etag:
30
+ - '"359670651"'
31
+ Expires:
32
+ - Tue, 21 Oct 2014 18:04:11 GMT
33
+ Last-Modified:
34
+ - Fri, 09 Aug 2013 23:54:35 GMT
35
+ Server:
36
+ - ECS (ftw/FBE4)
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: Tue, 14 Oct 2014 18:04:11 GMT
64
+ recorded_with: VCR 2.9.3
@@ -25,15 +25,15 @@ http_interactions:
25
25
  Content-Type:
26
26
  - text/html
27
27
  Date:
28
- - Fri, 10 Oct 2014 06:26:07 GMT
28
+ - Tue, 14 Oct 2014 18:04:11 GMT
29
29
  Etag:
30
30
  - '"359670651"'
31
31
  Expires:
32
- - Fri, 17 Oct 2014 06:26:07 GMT
32
+ - Tue, 21 Oct 2014 18:04:11 GMT
33
33
  Last-Modified:
34
34
  - Fri, 09 Aug 2013 23:54:35 GMT
35
35
  Server:
36
- - ECS (rhv/818F)
36
+ - ECS (ftw/FBE4)
37
37
  X-Cache:
38
38
  - HIT
39
39
  X-Ec-Custom-Error:
@@ -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: Fri, 10 Oct 2014 06:26:07 GMT
63
+ recorded_at: Tue, 14 Oct 2014 18:04:11 GMT
64
64
  recorded_with: VCR 2.9.3
@@ -0,0 +1,21 @@
1
+ require "helper"
2
+
3
+ MinitestVcr::Spec.configure!
4
+
5
+ describe MinitestVcr::Spec, :vcr => {:tag => :some_tag, :match_requests_on => [:method, :uri, :body]} do
6
+ before do
7
+ conn = Faraday.new
8
+ @response = conn.get "http://example.com"
9
+ end
10
+
11
+ it "top level example" do
12
+ VCR.current_cassette.name.must_equal "MinitestVcr/Spec/top level example"
13
+ end
14
+
15
+ describe "nested describe" do
16
+ it "example in nested describe" do
17
+ VCR.current_cassette.name.must_equal "MinitestVcr/Spec/nested describe/example in nested describe"
18
+ end
19
+ end
20
+
21
+ end
@@ -12,7 +12,8 @@ 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::Spec',
15
+ 'MinitestVcr',
16
+ 'Spec',
16
17
  'a describe with metadata',
17
18
  'with a nested example group',
18
19
  'uses a cassette for any examples'
@@ -29,7 +30,8 @@ describe MinitestVcr::Spec do
29
30
  end
30
31
  it 'uses a cassette for any examples', :vcr do
31
32
  (VCR.current_cassette.name.split('/')).must_equal([
32
- 'MinitestVcr::Spec',
33
+ 'MinitestVcr',
34
+ 'Spec',
33
35
  'an it with metadata',
34
36
  'with a nested example group',
35
37
  '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.0.1
4
+ version: 1.2.0
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-10 00:00:00.000000000 Z
11
+ date: 2014-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vcr
@@ -168,12 +168,15 @@ files:
168
168
  - lib/minitest-vcr/spec.rb
169
169
  - lib/minitest-vcr/version.rb
170
170
  - minitest-vcr.gemspec
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
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
174
176
  - test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
175
177
  - test/helper.rb
176
178
  - test/minitest-vcr/metadata_test.rb
179
+ - test/minitest-vcr/nested_describe_test.rb
177
180
  - test/minitest-vcr/spec_test.rb
178
181
  homepage: ''
179
182
  licenses:
@@ -200,10 +203,13 @@ signing_key:
200
203
  specification_version: 4
201
204
  summary: Allows VCR to automatically make cassetes with proper file paths with MiniTest
202
205
  test_files:
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
205
- - test/cassettes/MinitestVcr_Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
206
+ - test/cassettes/MinitestVcr/Spec/a_describe_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
207
+ - test/cassettes/MinitestVcr/Spec/an_it_with_metadata/with_a_nested_example_group/can_supply_metadata.yml
208
+ - test/cassettes/MinitestVcr/Spec/an_it_with_metadata/with_a_nested_example_group/uses_a_cassette_for_any_examples.yml
209
+ - test/cassettes/MinitestVcr/Spec/nested_describe/example_in_nested_describe.yml
210
+ - test/cassettes/MinitestVcr/Spec/top_level_example.yml
206
211
  - test/cassettes/with_tag_metadata/uses_appropraite_cassette_name.yml
207
212
  - test/helper.rb
208
213
  - test/minitest-vcr/metadata_test.rb
214
+ - test/minitest-vcr/nested_describe_test.rb
209
215
  - test/minitest-vcr/spec_test.rb