class Pact::Consumer::InteractionList

def add interactions

def add interactions
  @interactions << interactions
end

def all_matched?

def all_matched?
  interaction_diffs.empty?
end

def clear

For testing, sigh
def clear
  @interactions = []
  @matched_interactions = []
  @unexpected_requests = []
end

def initialize

def initialize
  clear
end

def interaction_diffs

def interaction_diffs
  {
    :missing_interactions => missing_interactions,
    :unexpected_requests => unexpected_requests.collect(&:as_json)
  }.inject({}) do | hash, pair |
    hash[pair.first] = pair.last if pair.last.any?
    hash
  end
end

def missing_interactions

def missing_interactions
  @interactions - @matched_interactions
end

def register_matched interaction

def register_matched interaction
  @matched_interactions << interaction
end

def register_unexpected request

Request::Actual
def register_unexpected request
  @unexpected_requests << request
end