Sha256: cdb931eeaa9bfce54bef6619922b210bd2cfce36559a4d034a5ab87b1e3cc9bd

Contents?: true

Size: 957 Bytes

Versions: 8

Compression:

Stored size: 957 Bytes

Contents

module PactBroker
  module Verifications
    class RequiredVerification
      attr_reader :provider_version, :provider_version_descriptions

      def initialize(attributes = {})
        attributes.each do | (name, value) |
          instance_variable_set("@#{name}", value) if respond_to?(name)
        end
      end

      def == other
        provider_version == other.provider_version && provider_version_descriptions == other.provider_version_descriptions
      end

      def + other
        if provider_version != other.provider_version
          raise PactBroker::Error.new("Can't + RequiredVerifications with different provider versions (#{provider_version.number}/#{other.provider_version.number})")
        end

        RequiredVerification.new(
          provider_version: provider_version,
          provider_version_descriptions: (provider_version_descriptions + other.provider_version_descriptions).uniq
        )
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pact_broker-2.88.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.87.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.86.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.85.1 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.85.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.84.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.83.0 lib/pact_broker/verifications/required_verification.rb
pact_broker-2.82.0 lib/pact_broker/verifications/required_verification.rb