Skip to content

Commit

Permalink
fix: use .empty? in handling_no_pacts_found
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Aug 8, 2024
1 parent 63809e9 commit 43bce74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/pact/pact_broker/fetch_pact_uris_for_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 43bce74

Please sign in to comment.