From 69251dc4f0e4efbef6cb9aca6c35511664e371f4 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 6 Aug 2024 22:30:27 +0100 Subject: [PATCH] chore: warn if fail_if_no_pacts_found is true and no pacts found --- lib/pact/pact_broker/fetch_pact_uris_for_verification.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb b/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb index 42ac64b3..1eecad23 100644 --- a/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb +++ b/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb @@ -101,11 +101,11 @@ def log_message def handling_no_pacts_found pacts_found = yield - if pacts_found.blank? && options[:fail_if_no_pacts_found] != false - raise "No pacts found to verify" - else - pacts_found + raise "No pacts found to verify" if pacts_found.blank? && options[:fail_if_no_pacts_found] != false + if pacts_found.blank? && options[:fail_if_no_pacts_found] == false + Pact.configuration.output_stream.puts "WARN: No pacts found to verify & fail_if_no_pacts_found is set to false." end + pacts_found end end end