class Pact::MockService::Interactions::InteractionMismatch

comes in that doesn’t match any of the expected interactions.
This is used to display a helpful message to the user when a request
expected interactions where the methods and paths match the actual request.

def initialize candidate_interactions, actual_request

def initialize candidate_interactions, actual_request
  @candidate_interactions = candidate_interactions
  @actual_request = actual_request
  @candidate_diffs = candidate_interactions.collect{ | candidate_interaction| CandidateDiff.new(candidate_interaction, actual_request)}
end

def short_summary

def short_summary
  mismatched_attributes = candidate_diffs.collect(&:mismatched_attributes).flatten.uniq.join(", ").reverse.sub(",", "dna ").reverse #OMG what a hack!
  actual_request.method_and_path + " (request #{mismatched_attributes} did not match)"
end

def to_hash

def to_hash
  candidate_diffs.collect(&:to_hash)
end

def to_s

def to_s
  candidate_diffs.collect(&:to_s).join("\n")
end