Sha256: bb520d0df9229eeb7a7bfd11e34f67db8de32317a156a212516492f7326e01cc

Contents?: true

Size: 852 Bytes

Versions: 2

Compression:

Stored size: 852 Bytes

Contents

require 'pact/consumer/mock_service/rack_request_helper'
module Pact
  module Consumer
    class MockServiceAdministrationEndpoint

      include RackRequestHelper

      attr_accessor :logger, :name

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

      def match? env
        (request_header_match? env) && (request_path_match? env) && (request_method_match? env)
      end

      def request_path
        raise NotImplementedError
      end

      def request_method
        raise NotImplementedError
      end

      private

      def request_header_match? env
        raise NotImplementedError
      end

      def request_path_match? env
        env['PATH_INFO'] == request_path
      end

      def request_method_match? env
        env['REQUEST_METHOD'] == request_method
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pact-mock_service-0.2.3 lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb
pact-mock_service-0.2.3.pre.rc2 lib/pact/consumer/mock_service/mock_service_administration_endpoint.rb