Sha256: 25d9bc3fedc30fb24772c158604cd77ee450d3858a58d803f178879382c43a07

Contents?: true

Size: 851 Bytes

Versions: 32

Compression:

Stored size: 851 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
          logger.info "Cleared interactions before example \"#{example_description(env)}\""
          [200, {}, ['Deleted interactions']]
        end

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
pact-mock_service-0.7.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.6.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.5 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.4 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.3 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.5.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.4.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.4.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.4.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.3.0 lib/pact/mock_service/request_handlers/interaction_delete.rb