Sha256: 95be9b9dd93cdc3040779ab23b6e1b63d62495139239db2ae3460251e42173c8

Contents?: true

Size: 775 Bytes

Versions: 44

Compression:

Stored size: 775 Bytes

Contents

require 'pact/consumer/mock_service/rack_request_helper'
require 'pact/consumer/mock_service/mock_service_administration_endpoint'

module Pact
  module Consumer

    class InteractionDelete < MockServiceAdministrationEndpoint

      include RackRequestHelper

      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
        'DELETE'
      end

      def respond env
        interaction_list.clear
        logger.info "Cleared interactions before example \"#{params_hash(env)['example_description']}\""
        [200, {}, ['Deleted interactions']]
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
pact-1.0.15 lib/pact/consumer/mock_service/interaction_delete.rb
pact-1.0.13 lib/pact/consumer/mock_service/interaction_delete.rb
pact-1.0.12 lib/pact/consumer/mock_service/interaction_delete.rb
pact-1.0.11 lib/pact/consumer/mock_service/interaction_delete.rb