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 1eecad23..dfde9d41 100644 --- a/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb +++ b/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb @@ -101,8 +101,8 @@ def log_message def handling_no_pacts_found pacts_found = yield - 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 + raise "No pacts found to verify" if pacts_found.empty? && options[:fail_if_no_pacts_found] != false + if pacts_found.empty? && 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 diff --git a/spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb b/spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb index c17800b2..3781ebf3 100644 --- a/spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb +++ b/spec/lib/pact/pact_broker/fetch_pact_uris_for_verification_spec.rb @@ -49,7 +49,7 @@ module PactBroker context "when the beta:provider-pacts-for-verification relation does not exist" do before do - allow(FetchPacts).to receive(:call) + allow(FetchPacts).to receive(:call).and_return([]) stub_request(:get, "http://broker.org/").to_return(status: 200, body: response_body, headers: response_headers) end