Sha256: 04d32dc952626f0bba63005a692112365274d4b94a77a10da3003f7f826a68a0

Contents?: true

Size: 842 Bytes

Versions: 171

Compression:

Stored size: 842 Bytes

Contents

module PactBroker
  module Verifications
    class SummaryForConsumerVersion

      attr_reader :verifications

      def initialize verifications, pacts
        @verifications = verifications
        @pacts = pacts
      end

      def success
        successful.count == pacts.count
      end

      def provider_summary
        OpenStruct.new(
          successful: successful,
          failed: failed,
          unknown: unknown
          )
      end

      private

      attr_reader :pacts

      def successful
        verifications.select(&:success).collect(&:provider_name)
      end

      def failed
        verifications.select{|verification| !verification.success }.collect(&:provider_name)
      end

      def unknown
        pacts.collect(&:provider_name) - verifications.collect(&:provider_name)
      end
    end
  end
end

Version data entries

171 entries across 171 versions & 1 rubygems

Version Path
pact_broker-2.68.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.68.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.67.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.66.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.65.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.64.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.63.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.62.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.61.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.60.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.60.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.59.2 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.59.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.59.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.58.3 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.58.2 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.58.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.57.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.56.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.56.0 lib/pact_broker/verifications/summary_for_consumer_version.rb