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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 92d18ca8bd1b86d4ae9c662ec2a44542527ea210
4
- data.tar.gz: 8c7fe0d434067f498247604d32e60d0fc464d59e
2
+ SHA256:
3
+ metadata.gz: 9b677a19e1ff31dc6603b612bb0e43df4f5a3f6d7922c8ea1fe6515898915f6c
4
+ data.tar.gz: f81ebbdc2ec57af625f095492ae60b1bf471cce4e0543d48349e0f031e6a5282
5
5
  SHA512:
6
- metadata.gz: 641f9838234b355e6e0fa3303a12cdad51479ad5ecffe2d5452a9e4e573929063bb2a6fffe4451a7e804a15e4b6613a82bd9c6a08225196cfe15732e07afddb1
7
- data.tar.gz: 90c860b8487295c6315b7d070b2df265d94da815eddbae30aab5c91f57a29396e4a0371d542815db00993437bde08ca95ee550e0836649a378e5a9764d05285b
6
+ metadata.gz: 2911a8d750ee6aa10285a7350dea230de47071f497c581aa4eb10302affcc8ab4e8b5771d7896d083ed46b8010737b39ecdbbfdaf0a408fef21f3fb6f4c03c92
7
+ data.tar.gz: 2d6c453ee8b51686b669e39e1fb138655a99ec6020313b72cd03e35eebbcbbcf80deabb1046808804db52c03ae565e9e6250adadb069b9e656d2fba1dd2dc3aa
@@ -1,3 +1,12 @@
1
+ <a name="v1.14.1"></a>
2
+ ### v1.14.1 (2020-02-27)
3
+
4
+
5
+ #### Bug Fixes
6
+
7
+ * correctly parse matching rules for request paths ([cc15a72](/../../commit/cc15a72))
8
+
9
+
1
10
  <a name="v1.14.0"></a>
2
11
  ### v1.14.0 (2020-02-13)
3
12
 
@@ -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], request_matching_rules[key], options)
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], response_matching_rules[key], options)
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
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.14.0"
3
+ VERSION = "1.14.1"
4
4
  end
5
5
  end
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.0
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-13 00:00:00.000000000 Z
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.14.3
302
+ rubygems_version: 2.7.6
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: Shared code for Pact gems