Skip to content

Commit

Permalink
fix: correct pact merge error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Mar 9, 2019
1 parent 6a25cc7 commit 5ebe808
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/pact_broker/client/merge_pacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def merge original, additional
private

def almost_duplicate_message(original, new_interaction)
"An interaction with same description (#{new_interaction[:description].inspect}) and provider state (#{new_interaction[:providerState].inspect}) but a different request or response has already been used. " +
"Please use a different description or provider state, or hard-code any random data.\n" +
original.to_json + "\n\n"
new_interaction.to_json
"Two interactions have been found with same description (#{new_interaction[:description].inspect}) and provider state (#{new_interaction[:providerState].inspect}) but a different request or response. " +
"Please use a different description or provider state, or hard-code any random data.\n\n" +
original.to_json + "\n\n" + new_interaction.to_json
end

def same_description_and_state? original, additional
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pact_broker/client/merge_pacts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module Client
end

it "raises an error" do
expect { subject }.to raise_error PactMergeError
expect { subject }.to raise_error PactMergeError, /foo.*different/
end
end
end
Expand Down

0 comments on commit 5ebe808

Please sign in to comment.