Sha256: 8242ac89dbcb15d332fa0a9ea1a5d886f6b3c51bc7ec543708c1221ac2d96316
Contents?: true
Size: 807 Bytes
Versions: 17
Compression:
Stored size: 807 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 interactions']] end end end end
Version data entries
17 entries across 17 versions & 1 rubygems