@@ -15,7 +15,7 @@ class PactVerificationFromBroker
15
15
# in parent scope, it will clash with these ones,
16
16
# so put an underscore in front of the name to be safer.
17
17
18
- attr_accessor :_provider_name , :_pact_broker_base_url , :_consumer_version_tags , :_provider_version_branch , :_provider_version_tags , :_basic_auth_options , :_enable_pending , :_include_wip_pacts_since , :_verbose , :_consumer_version_selectors
18
+ attr_accessor :_provider_name , :_pact_broker_base_url , :_consumer_version_tags , :_provider_version_branch , :_provider_version_tags , :_basic_auth_options , :_enable_pending , :_include_wip_pacts_since , :_verbose , :_consumer_version_selectors , :_fail_if_no_pacts_found
19
19
20
20
def initialize ( provider_name , provider_version_branch , provider_version_tags )
21
21
@_provider_name = provider_name
@@ -26,6 +26,7 @@ def initialize(provider_name, provider_version_branch, provider_version_tags)
26
26
@_enable_pending = false
27
27
@_include_wip_pacts_since = nil
28
28
@_verbose = false
29
+ @_fail_if_no_pacts_found = true # CLI defaults to false, unfortunately for consistency
29
30
end
30
31
31
32
dsl do
@@ -46,6 +47,11 @@ def enable_pending enable_pending
46
47
self . _enable_pending = enable_pending
47
48
end
48
49
50
+ # Underlying code defaults to true if not specified
51
+ def fail_if_no_pacts_found fail_if_no_pacts_found
52
+ self . _fail_if_no_pacts_found = fail_if_no_pacts_found
53
+ end
54
+
49
55
def include_wip_pacts_since since
50
56
self . _include_wip_pacts_since = if since . respond_to? ( :xmlschema )
51
57
since . xmlschema
@@ -74,7 +80,7 @@ def create_pact_verification
74
80
_provider_version_tags ,
75
81
_pact_broker_base_url ,
76
82
_basic_auth_options . merge ( verbose : _verbose ) ,
77
- { include_pending_status : _enable_pending , include_wip_pacts_since : _include_wip_pacts_since }
83
+ { include_pending_status : _enable_pending , include_wip_pacts_since : _include_wip_pacts_since , fail_if_no_pacts_found : _fail_if_no_pacts_found }
78
84
)
79
85
80
86
Pact . provider_world . add_pact_uri_source fetch_pacts
0 commit comments