Sha256: 1dd7e21950c73d6da4b1a18c796ca1113ab61fe93b8a31b57e4afe9a0d2a16cc

Contents?: true

Size: 972 Bytes

Versions: 2

Compression:

Stored size: 972 Bytes

Contents

require 'pact/consumer/mock_service/web_request_administration'
require 'pact/consumer/mock_service/verification'

module Pact
  module Consumer

    class MissingInteractionsGet < WebRequestAdministration
      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

2 entries across 2 versions & 1 rubygems

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