pact-message 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/pact/consumer_contract/message.rb +11 -15
- data/lib/pact/message/version.rb +1 -1
- data/script/update-pact.sh +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef9df4e508dca614f25914df88e80e1871316975
|
4
|
+
data.tar.gz: 93bdc495602316c7b62b0a4b40ec356162f03a60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb5765686e2fab5838b7a92b6872a231f70d928849f94bc4c397f44a019ef09a41bf0221eddc12c04f591f92ce11a053002e206629ed2874fded5a579d43b35c
|
7
|
+
data.tar.gz: 5546f4ae753b1590d8f13efcfe8951b8496bc2e3a647410b1266f285bfad034df6aa17b91ddd0be96c0966576dbaf5e86dd6e1d4db940d4bbb99fd88470b90ef
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
<a name="v0.4.1"></a>
|
2
|
+
### v0.4.1 (2018-04-05)
|
3
|
+
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* read/write metaData from/to v3 pact files ([7dfcbb9](/../../commit/7dfcbb9))
|
8
|
+
|
9
|
+
|
10
|
+
#### Bug Fixes
|
11
|
+
|
12
|
+
* locate content matching rules from correct path ([5254c01](/../../commit/5254c01))
|
13
|
+
|
14
|
+
|
1
15
|
<a name="v0.4.0"></a>
|
2
16
|
### v0.4.0 (2018-04-03)
|
3
17
|
|
@@ -13,12 +13,13 @@ module Pact
|
|
13
13
|
include Pact::ActiveSupportSupport
|
14
14
|
include Pact::SymbolizeKeys
|
15
15
|
|
16
|
-
attr_accessor :description, :content, :provider_state
|
16
|
+
attr_accessor :description, :content, :provider_state, :metadata
|
17
17
|
|
18
18
|
def initialize attributes = {}
|
19
19
|
@description = attributes[:description]
|
20
20
|
@provider_state = attributes[:provider_state] || attributes[:providerState]
|
21
21
|
@content = attributes[:content]
|
22
|
+
@metadata = attributes[:metadata]
|
22
23
|
end
|
23
24
|
|
24
25
|
def self.from_hash hash, options = {}
|
@@ -26,28 +27,22 @@ module Pact
|
|
26
27
|
unless opts[:pact_specification_version]
|
27
28
|
opts[:pact_specification_version] = Pact::SpecificationVersion::NIL_VERSION
|
28
29
|
end
|
29
|
-
|
30
|
+
content_matching_rules = hash['matchingRules'] && hash['matchingRules']['body']
|
31
|
+
content_hash = Pact::MatchingRules.merge(hash['content'], content_matching_rules, opts)
|
30
32
|
content = Pact::ConsumerContract::Message::Content.from_hash(content_hash)
|
33
|
+
metadata = hash['metaData']
|
31
34
|
provider_state = hash['providerStates'] && hash['providerStates'].first && hash['providerStates'].first['name']
|
32
35
|
warn_if_multiple_provider_states(provider_state, hash)
|
33
36
|
warn_if_params_used_in_provider_states(hash)
|
34
|
-
new(symbolize_keys(hash).merge(content: content, provider_state: provider_state))
|
37
|
+
new(symbolize_keys(hash).merge(content: content, provider_state: provider_state, metadata: metadata))
|
35
38
|
end
|
36
39
|
|
37
40
|
def to_hash
|
38
41
|
{
|
39
42
|
description: description,
|
40
|
-
|
43
|
+
provider_states: [{ name: provider_state }],
|
41
44
|
content: content.to_hash,
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
# todo move this proper decorator
|
46
|
-
def as_json
|
47
|
-
{
|
48
|
-
description: description,
|
49
|
-
providerState: provider_state,
|
50
|
-
content: content.as_json
|
45
|
+
metadata: metadata
|
51
46
|
}
|
52
47
|
end
|
53
48
|
|
@@ -56,11 +51,12 @@ module Pact
|
|
56
51
|
path: '/',
|
57
52
|
method: 'POST',
|
58
53
|
query: nil,
|
59
|
-
headers: {'Content-Type' => 'application/json'},
|
54
|
+
headers: { 'Content-Type' => 'application/json' },
|
60
55
|
body: {
|
61
56
|
description: description,
|
62
57
|
providerStates: [{
|
63
|
-
name: provider_state
|
58
|
+
name: provider_state,
|
59
|
+
params: {}
|
64
60
|
}]
|
65
61
|
}
|
66
62
|
)
|
data/lib/pact/message/version.rb
CHANGED
data/script/update-pact.sh
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-message
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Beth Skurrie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pact-support
|