Sha256: b89bbeb2272cb4b56dab8521182f1a4395f202cfd94db2665c70dec9baa8244d

Contents?: true

Size: 1013 Bytes

Versions: 7

Compression:

Stored size: 1013 Bytes

Contents

module Pact
  module PactBroker
    module PactSelectionDescription
      def pact_selection_description(provider, consumer_version_selectors, options, broker_base_url)
        latest = consumer_version_selectors.any? ? "" : "latest "
        message = "Fetching pacts for #{provider} from #{broker_base_url} with the selection criteria: "
        if consumer_version_selectors.any?
          desc = consumer_version_selectors.collect do |selector|
            all_or_latest = !selector[:latest] ? "all for tag" : "latest for tag"
            fallback = selector[:fallback] || selector[:fallbackTag]
            name = fallback ? "#{selector[:tag]} (or #{fallback} if not found)" : selector[:tag]
            "#{all_or_latest} #{name}"
          end.join(", ")
          if options[:include_wip_pacts_since]
            desc = "#{desc}, work in progress pacts created after #{options[:include_wip_pacts_since]}"
          end
          message << "#{desc}"
        end
        message
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pact-1.55.6 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.5 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.4 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.3 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.2 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.1 lib/pact/pact_broker/pact_selection_description.rb
pact-1.55.0 lib/pact/pact_broker/pact_selection_description.rb