Sha256: 3ae4f748ae23fea417c4151f974f5da7259d0ddbf11f8431718dd722eadd5ee2
Contents?: true
Size: 849 Bytes
Versions: 75
Compression:
Stored size: 849 Bytes
Contents
require 'net/http' require 'pact/reification' require 'pact/consumer_contract/interaction' module Pact module Consumer class InteractionBuilder attr_reader :interaction def initialize &block @interaction = Interaction.new @callback = block end def upon_receiving description @interaction.description = description self end def given provider_state @interaction.provider_state = provider_state.nil? ? nil : provider_state.to_s self end def with(request_details) interaction.request = Pact::Request::Expected.from_hash(request_details) self end def will_respond_with(response) interaction.response = Pact::Response.new(response) @callback.call interaction self end end end end
Version data entries
75 entries across 75 versions & 1 rubygems