pact 1.55.3 → 1.56.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/lib/pact/cli/run_pact_verification.rb +1 -0
- data/lib/pact/pact_broker/pact_selection_description.rb +2 -2
- data/lib/pact/provider/help/write.rb +2 -0
- data/lib/pact/provider/pact_uri.rb +13 -2
- data/lib/pact/provider/rspec.rb +4 -3
- data/lib/pact/provider/rspec/formatter_rspec_3.rb +1 -0
- data/lib/pact/provider/rspec/matchers.rb +1 -1
- data/lib/pact/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '07691380e13b6856eb1c2df42bf7ce5f360ed46b8e75aff4e122c22f685e45b5'
|
4
|
+
data.tar.gz: f2ce2cf40b492b0f163fe27732ef09f37c5b1a5061a05e07427807343cfee431
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf78bed99d4180a145ae7edf411a8d6840e622e315f2b1173294ded82288b87d404ef23796e38bb025fea51f8e437a09fc7d5e643835156400bda73cafc64ebe
|
7
|
+
data.tar.gz: a69c674a42bab959fe7483ac568a2e7102d141f3d861327c1b4f64c4d7e22864f298385917fbbb0b93bcc205565c4233d4a455423885d91a86b315796063c2b4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
<a name="v1.56.0"></a>
|
2
|
+
### v1.56.0 (2021-01-22)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* catch and log error during help text generation ([182a7cd](/../../commit/182a7cd))
|
7
|
+
|
8
|
+
<a name="v1.55.7"></a>
|
9
|
+
### v1.55.7 (2020-11-25)
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* add consumer name to the selection description (#229) ([5127036](/../../commit/5127036))
|
14
|
+
|
15
|
+
<a name="v1.55.6"></a>
|
16
|
+
### v1.55.6 (2020-11-06)
|
17
|
+
|
18
|
+
#### Bug Fixes
|
19
|
+
|
20
|
+
* require rspec now that pact-support does not depend on it ([5b5c27c](/../../commit/5b5c27c))
|
21
|
+
|
22
|
+
<a name="v1.55.5"></a>
|
23
|
+
### v1.55.5 (2020-10-12)
|
24
|
+
|
25
|
+
#### Bug Fixes
|
26
|
+
|
27
|
+
* **security**
|
28
|
+
* hide personal access token given in uri (#225) ([f6db12d](/../../commit/f6db12d))
|
29
|
+
|
30
|
+
<a name="v1.55.4"></a>
|
31
|
+
### v1.55.4 (2020-10-09)
|
32
|
+
|
33
|
+
#### Bug Fixes
|
34
|
+
|
35
|
+
* add back missing output describing the interactions filter ([1a2d7c1](/../../commit/1a2d7c1))
|
36
|
+
|
1
37
|
<a name="v1.55.3"></a>
|
2
38
|
### v1.55.3 (2020-09-28)
|
3
39
|
|
@@ -27,6 +27,7 @@ module Pact
|
|
27
27
|
# With RSpec3, if the pact_helper loads a library that adds its own formatter before we set one,
|
28
28
|
# we will get a ProgressFormatter too, and get little dots sprinkled throughout our output.
|
29
29
|
# Load a NilFormatter here to prevent that.
|
30
|
+
require 'rspec'
|
30
31
|
require 'pact/rspec'
|
31
32
|
::RSpec.configuration.add_formatter Pact::RSpec.formatter_class.const_get('NilFormatter')
|
32
33
|
end
|
@@ -2,14 +2,14 @@ module Pact
|
|
2
2
|
module PactBroker
|
3
3
|
module PactSelectionDescription
|
4
4
|
def pact_selection_description(provider, consumer_version_selectors, options, broker_base_url)
|
5
|
-
latest = consumer_version_selectors.any? ? "" : "latest "
|
6
5
|
message = "Fetching pacts for #{provider} from #{broker_base_url} with the selection criteria: "
|
7
6
|
if consumer_version_selectors.any?
|
8
7
|
desc = consumer_version_selectors.collect do |selector|
|
9
8
|
all_or_latest = !selector[:latest] ? "all for tag" : "latest for tag"
|
9
|
+
consumer = selector[:consumer] ? "of consumer #{selector[:consumer]}" : nil
|
10
10
|
fallback = selector[:fallback] || selector[:fallbackTag]
|
11
11
|
name = fallback ? "#{selector[:tag]} (or #{fallback} if not found)" : selector[:tag]
|
12
|
-
|
12
|
+
[all_or_latest, name, consumer].compact.join(" ")
|
13
13
|
end.join(", ")
|
14
14
|
if options[:include_wip_pacts_since]
|
15
15
|
desc = "#{desc}, work in progress pacts created after #{options[:include_wip_pacts_since]}"
|
@@ -17,7 +17,7 @@ module Pact
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def basic_auth?
|
20
|
-
!!username
|
20
|
+
!!username && !!password
|
21
21
|
end
|
22
22
|
|
23
23
|
def username
|
@@ -29,12 +29,23 @@ module Pact
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def to_s
|
32
|
-
if basic_auth? &&
|
32
|
+
if basic_auth? && http_or_https_uri?
|
33
33
|
URI(@uri).tap { |x| x.userinfo="#{username}:*****"}.to_s
|
34
|
+
elsif personal_access_token? && http_or_https_uri?
|
35
|
+
URI(@uri).tap { |x| x.userinfo="*****"}.to_s
|
34
36
|
else
|
35
37
|
uri
|
36
38
|
end
|
37
39
|
end
|
40
|
+
|
41
|
+
private def personal_access_token?
|
42
|
+
!!username && !password
|
43
|
+
end
|
44
|
+
|
45
|
+
private def http_or_https_uri?
|
46
|
+
uri.start_with?('http://', 'https://')
|
47
|
+
end
|
48
|
+
|
38
49
|
end
|
39
50
|
end
|
40
51
|
end
|
data/lib/pact/provider/rspec.rb
CHANGED
@@ -26,8 +26,10 @@ module Pact
|
|
26
26
|
Pact.configuration.output_stream.puts "INFO: Reading pact at #{pact_uri}"
|
27
27
|
consumer_contract = Pact::ConsumerContract.from_json(pact_json)
|
28
28
|
suffix = pact_uri.metadata[:pending] ? " [PENDING]": ""
|
29
|
+
example_group_description = "Verifying a pact between #{consumer_contract.consumer.name} and #{consumer_contract.provider.name}#{suffix}"
|
30
|
+
example_group_metadata = { pactfile_uri: pact_uri, pact_criteria: options[:criteria] }
|
29
31
|
|
30
|
-
::RSpec.describe
|
32
|
+
::RSpec.describe example_group_description, example_group_metadata do
|
31
33
|
honour_consumer_contract consumer_contract, options.merge(
|
32
34
|
pact_json: pact_json,
|
33
35
|
pact_uri: pact_uri,
|
@@ -90,8 +92,7 @@ module Pact
|
|
90
92
|
pact_uri: options[:pact_uri],
|
91
93
|
pact_source: options[:pact_source],
|
92
94
|
pact_ignore_failures: options[:pact_source].pending? || options[:ignore_failures],
|
93
|
-
pact_consumer_contract: options[:consumer_contract]
|
94
|
-
pact_criteria: options[:criteria]
|
95
|
+
pact_consumer_contract: options[:consumer_contract]
|
95
96
|
}
|
96
97
|
|
97
98
|
describe description_for(interaction), metadata do
|
@@ -25,6 +25,7 @@ module Pact
|
|
25
25
|
C = ::Term::ANSIColor
|
26
26
|
|
27
27
|
def example_group_started(notification)
|
28
|
+
# This is the metadata on the top level "Verifying a pact between X and Y" describe block
|
28
29
|
if @group_level == 0
|
29
30
|
Pact.configuration.output_stream.puts
|
30
31
|
pact_uri = notification.group.metadata[:pactfile_uri]
|
@@ -8,7 +8,7 @@ module Pact
|
|
8
8
|
module RSpec
|
9
9
|
module Matchers
|
10
10
|
module RSpec2Delegator
|
11
|
-
# For backwards
|
11
|
+
# For backwards compatibility with rspec-2
|
12
12
|
def method_missing(method, *args, &block)
|
13
13
|
if method_name == :failure_message_for_should
|
14
14
|
failure_message method, *args, &block
|
data/lib/pact/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.56.0
|
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:
|
15
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -405,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
405
405
|
- !ruby/object:Gem::Version
|
406
406
|
version: '0'
|
407
407
|
requirements: []
|
408
|
-
rubygems_version: 3.
|
408
|
+
rubygems_version: 3.2.6
|
409
409
|
signing_key:
|
410
410
|
specification_version: 4
|
411
411
|
summary: Enables consumer driven contract testing, providing a mock service and DSL
|