pact-support 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/pact/matching_rules/v3/merge.rb +5 -1
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/matching_rules/v3/merge_spec.rb +23 -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: 20803ab69ce7de1114071b9920664f7f48824c66
|
4
|
+
data.tar.gz: 290ea395354b4122de84a607f684919b99a91ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908d1db1d4356dbe878d2373c7092c1ed007482a490a199c5fb7045d02dcc57775e1378627714e1e7e07310e3419551194af9816eb291080ea778362b978e89a
|
7
|
+
data.tar.gz: 5dab25c5ec872af637559ea7ac255b9614c4b630963bf0ac9698a089d0771cdf19f5c164c351944835f8c4fa759cb4335064af5737f8733d660c3b2cb2266a50
|
data/CHANGELOG.md
CHANGED
@@ -116,7 +116,7 @@ module Pact
|
|
116
116
|
if @matching_rules.any?
|
117
117
|
@matching_rules.each do | path, rules_hash |
|
118
118
|
rules_hash.each do | key, value |
|
119
|
-
$stderr.puts "WARN: Ignoring unsupported #{key} #{value} for path #{path}" if value
|
119
|
+
$stderr.puts "WARN: Ignoring unsupported #{key} #{value} for path #{path}" if value_present?(value)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
@@ -129,6 +129,10 @@ module Pact
|
|
129
129
|
def log_used_rule path, key, value
|
130
130
|
@used_rules << [path, key, value]
|
131
131
|
end
|
132
|
+
|
133
|
+
def value_present? value
|
134
|
+
value.respond_to?(:any?) ? value.any? : true
|
135
|
+
end
|
132
136
|
end
|
133
137
|
end
|
134
138
|
end
|
data/lib/pact/support/version.rb
CHANGED
@@ -456,6 +456,29 @@ module Pact
|
|
456
456
|
end
|
457
457
|
end
|
458
458
|
|
459
|
+
describe "with a combine key" do
|
460
|
+
let(:expected) do
|
461
|
+
{
|
462
|
+
"foo" => "bar"
|
463
|
+
}
|
464
|
+
end
|
465
|
+
|
466
|
+
let(:matching_rules) do
|
467
|
+
{
|
468
|
+
"$.foo" => {
|
469
|
+
"matchers" => [{ "match" => "type" }],
|
470
|
+
"combine" => "AND"
|
471
|
+
}
|
472
|
+
}
|
473
|
+
|
474
|
+
end
|
475
|
+
|
476
|
+
it "logs the ignored rule" do
|
477
|
+
allow(Pact.configuration.error_stream).to receive(:puts)
|
478
|
+
expect(Pact.configuration.error_stream).to receive(:puts).with("WARN: Ignoring unsupported combine AND for path $['foo']")
|
479
|
+
subject
|
480
|
+
end
|
481
|
+
end
|
459
482
|
end
|
460
483
|
end
|
461
484
|
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.8.
|
4
|
+
version: 1.8.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: 2018-
|
15
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|