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-2.2.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.1.1.pre.alpha.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.1.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.0.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-2.0.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-1.2.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-1.1.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-1.0.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.12.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.12.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.11.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.10.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.10.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.10.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.9.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.8.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.8.1 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.8.0 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.7.2 lib/pact/mock_service/request_handlers/interaction_delete.rb
pact-mock_service-0.7.1 lib/pact/mock_service/request_handlers/interaction_delete.rb