apivore 1.5.0 → 1.6.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 +8 -8
- data/lib/apivore/rspec_matchers.rb +13 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzBiZTZlMWJkODVkNDhmNDYwMjFmNTc1OWMyMzlhNDg3YTZjM2Q5ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDZiMTNmNjNlODAwNTNhYzQ3NzllODg1ZjIxNjI4NWIyMjQ2NGNmZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTQyMzE1YjNjYWUyNzUyODc5NjA1MTlkOTM3MmY3NzhkMmVmNWI4MmU5NTk2
|
10
|
+
NTZiMjVmODA4NzBkYmU1ZGY1NTlkNjNhYjQ3NDQ3MDM5MTEyMTE3OWQxY2I1
|
11
|
+
MGM5Nzg3ZTI0MTA4M2MzNWYyYjQ4YTdlOGM0YjMzMzgxYjUyOWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWFmOTFmYWI5MjljZTU0YTY4ODVkMzZhMzU5ZjEwNDQ4MzI2M2Y2MmI0NTZk
|
14
|
+
ZWY2ZmNiYjJhZDliOGU4ZDM4OWI1YmUwMzM0ZGQ0ODJiNjI5YzkzZGMwZmM1
|
15
|
+
MTNiYjA1ZjZiYTBmNWNmNGYwODNjZGM3ZTkxNjQyZjdlNmMzMDU=
|
@@ -4,7 +4,7 @@ require 'net/http'
|
|
4
4
|
module Apivore
|
5
5
|
module RspecMatchers
|
6
6
|
extend RSpec::Matchers::DSL
|
7
|
-
matcher :be_consistent_with_swagger_definitions do |
|
7
|
+
matcher :be_consistent_with_swagger_definitions do |master_swagger_url, current_service|
|
8
8
|
|
9
9
|
attr_reader :actual, :expected
|
10
10
|
|
@@ -22,8 +22,18 @@ module Apivore
|
|
22
22
|
end
|
23
23
|
|
24
24
|
define_method :fetch_master_swagger do
|
25
|
-
|
26
|
-
|
25
|
+
res =
|
26
|
+
if master_swagger_url.starts_with? 'http'
|
27
|
+
Net::HTTP.get_response(URI(master_swagger_url))
|
28
|
+
else
|
29
|
+
Net::HTTP.get_response(master_swagger_url, "/swagger.json")
|
30
|
+
end
|
31
|
+
|
32
|
+
unless res.is_a? Net::HTTPSuccess
|
33
|
+
message = "Master swagger at #{master_swagger_url} not accessible\n"
|
34
|
+
fail (message + res.body)
|
35
|
+
end
|
36
|
+
JSON.parse(res.body)
|
27
37
|
end
|
28
38
|
|
29
39
|
define_method :master_swagger do
|