Sha256: a249f6d7abc18d62a9bb5d9c6de44724eaf8e1c2b783a05354e779c7a26e9e2b

Contents?: true

Size: 991 Bytes

Versions: 1

Compression:

Stored size: 991 Bytes

Contents

require 'pact/consumer/mock_service/mock_service_administration_endpoint'
require 'pact/consumer/mock_service/verification'

module Pact
  module Consumer

    class MissingInteractionsGet < MockServiceAdministrationEndpoint
      include RackRequestHelper

      def initialize name, logger, expected_interactions, actual_interactions
        super name, logger
        @expected_interactions = expected_interactions
        @actual_interactions = actual_interactions
      end

      def request_path
        '/interactions/missing'
      end

      def request_method
        'GET'
      end

      def respond env
        verification = Verification.new(@expected_interactions, @actual_interactions)
        number_of_missing_interactions = verification.missing_interactions.size
        logger.info "Number of missing interactions for mock \"#{name}\" = #{number_of_missing_interactions}"
        [200, {}, [{size: number_of_missing_interactions}.to_json]]
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact-mock_service-0.2.3.pre.rc1 lib/pact/consumer/mock_service/missing_interactions_get.rb