Sha256: a0d0f3de30556bf08f504e923c37a374fe1cbc6fd3d21d50bb1c373bcba81429
Contents?: true
Size: 1.08 KB
Versions: 17
Compression:
Stored size: 1.08 KB
Contents
require 'pact/mock_service/request_handlers/base_administration_request_handler' require 'pact/mock_service/interaction_decorator' require 'pact/shared/json_differ' require 'pact/mock_service/request_handlers/interaction_post' #Refactor diff message module Pact module MockService module RequestHandlers class InteractionsPut < BaseAdministrationRequestHandler def initialize name, logger, session super name, logger @session = session end def request_path '/interactions' end def request_method 'PUT' end def respond env request_body = JSON.load(env['rack.input'].string) interactions = request_body['interactions'].collect { | hash | Interaction.from_hash(hash) } begin session.set_expected_interactions interactions text_response('Registered interactions') rescue Pact::Error => e text_response(e.message, 500) end end private attr_accessor :session end end end end
Version data entries
17 entries across 17 versions & 1 rubygems