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: a8ce3f1674f46c2c7791386f64e694d0170a7693d16b89a5c21923cb23cc58b2
4
- data.tar.gz: 615878aa004e98712a802c0dd44ca42465edd5b86c5bd6744cfe1f10dd79c953
3
+ metadata.gz: f4ac78604afe839b594b928d23fb32cdbab87b822dfda1b019a56a6cc99847b6
4
+ data.tar.gz: 8ae114534430f0abed7a4618fc2239ea9696dc4532be9569696ab4e2de354faf
5
5
  SHA512:
6
- metadata.gz: d71a291c462a84e94878134ec1e006d0063ee8fb9ef2ba5ece050e821af5b4075d8fcba40670beaa35dfef3cce5d00d369ed12666a0e218e62d8cd98efc82846
7
- data.tar.gz: e3a4c671f8ffb61f9e1db4c89c857acf6c700c9f02dca499d2f727eb70c924fab8bbc509bf486e960a02e220a4536ec79d448a6b0772b3492dfc880526c0a0e0
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
- expect_validate_request(code, metadata: example.metadata[:openapi_rspec])
6
- instance_eval &block if block_given?
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)
@@ -1,3 +1,3 @@
1
1
  module OpenapiRspec
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-08-05 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable