pact-support 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +9 -0
- data/lib/pact/consumer_contract/interaction_v3_parser.rb +15 -5
- data/lib/pact/support/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9b677a19e1ff31dc6603b612bb0e43df4f5a3f6d7922c8ea1fe6515898915f6c
|
4
|
+
data.tar.gz: f81ebbdc2ec57af625f095492ae60b1bf471cce4e0543d48349e0f031e6a5282
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2911a8d750ee6aa10285a7350dea230de47071f497c581aa4eb10302affcc8ab4e8b5771d7896d083ed46b8010737b39ecdbbfdaf0a408fef21f3fb6f4c03c92
|
7
|
+
data.tar.gz: 2d6c453ee8b51686b669e39e1fb138655a99ec6020313b72cd03e35eebbcbbcf80deabb1046808804db52c03ae565e9e6250adadb069b9e656d2fba1dd2dc3aa
|
data/CHANGELOG.md
CHANGED
@@ -20,9 +20,9 @@ module Pact
|
|
20
20
|
Pact.configuration.error_stream.puts("WARN: Currently only 1 provider state is supported. Ignoring ")
|
21
21
|
end
|
22
22
|
metadata = parse_metadata(hash['metadata'])
|
23
|
-
Interaction.new(symbolize_keys(hash).merge(request: request,
|
24
|
-
response: response,
|
25
|
-
provider_states: provider_states,
|
23
|
+
Interaction.new(symbolize_keys(hash).merge(request: request,
|
24
|
+
response: response,
|
25
|
+
provider_states: provider_states,
|
26
26
|
provider_state: provider_state,
|
27
27
|
metadata: metadata))
|
28
28
|
end
|
@@ -47,14 +47,14 @@ module Pact
|
|
47
47
|
|
48
48
|
def self.parse_request_with_non_string_body request_hash, request_matching_rules, options
|
49
49
|
request_hash = request_hash.keys.each_with_object({}) do | key, new_hash |
|
50
|
-
new_hash[key] = Pact::MatchingRules.merge(request_hash[key],
|
50
|
+
new_hash[key] = Pact::MatchingRules.merge(request_hash[key], look_up_matching_rules(key, request_matching_rules), options)
|
51
51
|
end
|
52
52
|
Pact::Request::Expected.from_hash(request_hash)
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.parse_response_with_non_string_body response_hash, response_matching_rules, options
|
56
56
|
response_hash = response_hash.keys.each_with_object({}) do | key, new_hash |
|
57
|
-
new_hash[key] = Pact::MatchingRules.merge(response_hash[key],
|
57
|
+
new_hash[key] = Pact::MatchingRules.merge(response_hash[key], look_up_matching_rules(key, response_matching_rules), options)
|
58
58
|
end
|
59
59
|
Pact::Response.from_hash(response_hash)
|
60
60
|
end
|
@@ -78,5 +78,15 @@ module Pact
|
|
78
78
|
def self.parse_metadata metadata_hash
|
79
79
|
symbolize_keys(metadata_hash)
|
80
80
|
end
|
81
|
+
|
82
|
+
def self.look_up_matching_rules(key, matching_rules)
|
83
|
+
# The matching rules for the path operate on the object itself and don't have sub paths
|
84
|
+
# Convert it into the format that Merge expects.
|
85
|
+
if key == 'path'
|
86
|
+
matching_rules[key] ? { '$.' => matching_rules[key] } : nil
|
87
|
+
else
|
88
|
+
matching_rules[key]
|
89
|
+
end
|
90
|
+
end
|
81
91
|
end
|
82
92
|
end
|
data/lib/pact/support/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2020-02-
|
15
|
+
date: 2020-02-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
299
|
version: '0'
|
300
300
|
requirements: []
|
301
301
|
rubyforge_project:
|
302
|
-
rubygems_version: 2.6
|
302
|
+
rubygems_version: 2.7.6
|
303
303
|
signing_key:
|
304
304
|
specification_version: 4
|
305
305
|
summary: Shared code for Pact gems
|