Sha256: 02517e53c73ae636023a3f2bea4cdafe9cc61262c727890135f14bd3301eb90e
Contents?: true
Size: 806 Bytes
Versions: 11
Compression:
Stored size: 806 Bytes
Contents
require 'pact/consumer/mock_service/mock_service_administration_endpoint' module Pact module Consumer class InteractionPost < MockServiceAdministrationEndpoint attr_accessor :interaction_list def initialize name, logger, interaction_list super name, logger @interaction_list = interaction_list end def request_path '/interactions' end def request_method 'POST' end def respond env interaction = Interaction.from_hash(JSON.load(env['rack.input'].string)) interaction_list.add interaction logger.info "Registered expected interaction #{interaction.request.method_and_path} for #{name}" logger.ap interaction.as_json [200, {}, ['Added interaction']] end end end end
Version data entries
11 entries across 11 versions & 1 rubygems