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.112.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.111.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.109.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.109.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.108.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.107.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.107.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.107.0.beta.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.106.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.105.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.104.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.103.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.102.2 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.102.1 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.102.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.101.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.100.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.99.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.98.0 lib/pact_broker/verifications/summary_for_consumer_version.rb
pact_broker-2.97.0 lib/pact_broker/verifications/summary_for_consumer_version.rb