vigia 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 839517ce635ec40f0392b395b499995141ce6f1e
4
- data.tar.gz: ead01a03d5b47e234b89a3b05c0ab08d015a1258
3
+ metadata.gz: 3c5a64fc8e29c2baf38e81587d991a0e62dedf24
4
+ data.tar.gz: dc220251eff74b8feaed637d4d2a4802936301d3
5
5
  SHA512:
6
- metadata.gz: 480f72fca1b7d0fe762def39949a025fd0f6e85502b1d49981359556f6a94724bb1683d70be14b57a3feceff594bfaf612a0bb813913dbec153d85b8f016c4f2
7
- data.tar.gz: 086906a7d54e9aab0cc1fd1b669ca822d00308bf7bb9daf143da07cd9bde54c929f2fd672e6db27021ecac84f69fd35a00e1390cc3cec3641395dd210622526e
6
+ metadata.gz: 1161a4e2a69ac0e9973c264233df0bc5c5be9619145281e8462b61386cfaba1805684340e242caa3cddaf7bb4534e35dcb507353ddea81078f5407090fc45811
7
+ data.tar.gz: aa904625ce42d4eb35c1c8d5c91c0ad3537661bff22c98b6a1121c1529bec72a7283309f3adbeb68d86bd58406ee7f0947d22d09fcbd5e60d543dde9401f0071
@@ -38,7 +38,7 @@ module Vigia
38
38
  uri_template: -> { adapter.resource_uri_template(method) },
39
39
  parameters: -> { adapter.parameters_for(method) },
40
40
  headers: -> { adapter.request_headers(body) },
41
- payload: -> { adapter.payload_for(method, body) if adapter.with_payload?(method.name) }
41
+ payload: -> { adapter.payload_for(method, body) }
42
42
  },
43
43
  expectations: {
44
44
  code: -> { response.name.to_i },
@@ -74,7 +74,9 @@ module Vigia
74
74
 
75
75
  def payload_for(method, body)
76
76
  return unless with_payload?(method.name)
77
- request_body_for(method, body).schema.value
77
+
78
+ payload = request_body_for(method, body)
79
+ payload.example || payload.schema.value
78
80
  end
79
81
 
80
82
  def with_payload?(method_name)
data/lib/vigia/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Vigia
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vigia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Tapiador
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-16 00:00:00.000000000 Z
12
+ date: 2016-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  requirements: []
248
248
  rubyforge_project:
249
- rubygems_version: 2.2.2
249
+ rubygems_version: 2.4.5.1
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Test your Apiary Blueprint specification on ruby