Sha256: 58daa519859792a26948eae51e2f47dc11f26841d56315aceac93f327adc9591

Contents?: true

Size: 955 Bytes

Versions: 48

Compression:

Stored size: 955 Bytes

Contents

require 'pact/mock_service/request_handlers/base_administration_request_handler'

module Pact
  module MockService
    module RequestHandlers

      class InteractionDelete < BaseAdministrationRequestHandler

        attr_accessor :session

        def initialize name, logger, session
          super name, logger
          @session = session
        end

        def request_path
          '/interactions'
        end

        def request_method
          'DELETE'
        end

        def respond env
          session.clear_expected_and_actual_interactions
          example_desc = example_description(env)
          example_desc = example_desc ? " for example #{example_desc.inspect}" : ''
          logger.info "Cleared interactions#{example_desc}"
          text_response('Cleared interactions')
        end

        def example_description env
          params_hash(env).fetch('example_description', [])[0]
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
pact-mock_service-2.6.3 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.6.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.6.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.5.4 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.5.3 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.5.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.4.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.3.0 lib/pact/mock_service/request_handlers/interaction_delete.rb