openapi_rspec 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4ac78604afe839b594b928d23fb32cdbab87b822dfda1b019a56a6cc99847b6
|
4
|
+
data.tar.gz: 8ae114534430f0abed7a4618fc2239ea9696dc4532be9569696ab4e2de354faf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3759f1eb45a8861db4cf0dfcc559a065f9c236ccd5bfdcdbd700268704cec2a0ed668da192720e28889db16c3115e37833b47c41a14b7a58c3dbe49ccf3cbdf9
|
7
|
+
data.tar.gz: 7c32542acbdd92476ea198c1211f160eed882ff98ec923364a9dad857e76677ffaf4786ac9fd4d33db4033528d42a02230fe59c3c45cbc5196601ed44ba1f4b9
|
@@ -1,9 +1,5 @@
|
|
1
1
|
module OpenapiRspec
|
2
2
|
module Helpers
|
3
|
-
def expect_validate_request(code, metadata: {})
|
4
|
-
expect(subject).to validate_request(**request_params(metadata), code: code)
|
5
|
-
end
|
6
|
-
|
7
3
|
def request_params(metadata)
|
8
4
|
{}.tap do |hash|
|
9
5
|
hash[:method] = defined?(http_method) ? http_method : metadata[:method]
|
@@ -2,8 +2,9 @@ module OpenapiRspec
|
|
2
2
|
module ModuleHelpers
|
3
3
|
def validate_code(code, &block)
|
4
4
|
specify do |example|
|
5
|
-
|
6
|
-
|
5
|
+
validator = RequestValidator.new(**request_params(example.metadata[:openapi_rspec]), code: code)
|
6
|
+
expect(subject).to validator
|
7
|
+
instance_exec validator, &block if block_given?
|
7
8
|
end
|
8
9
|
end
|
9
10
|
|
@@ -19,7 +19,7 @@ module OpenapiRspec
|
|
19
19
|
@params = params
|
20
20
|
end
|
21
21
|
|
22
|
-
attr_reader :method, :path, :code, :media_type, :query, :headers, :params
|
22
|
+
attr_reader :method, :path, :code, :media_type, :query, :headers, :params, :response
|
23
23
|
|
24
24
|
def matches?(doc)
|
25
25
|
@result = doc.validate_request(path: path, method: method, code: code, media_type: media_type)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svyatoslav Kryukov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|