class PactBroker::Pacts::BuildVerifiablePactNotices

Public Class Methods

append_notice(notices, the_when, text) click to toggle source
# File lib/pact_broker/pacts/build_verifiable_pact_notices.rb, line 28
def self.append_notice notices, the_when, text
  if text
    notices << {
      when: the_when,
      text: text
    }
  end
end
call(verifiable_pact, pact_url, options) click to toggle source
# File lib/pact_broker/pacts/build_verifiable_pact_notices.rb, line 7
def self.call(verifiable_pact, pact_url, options)
  messages = VerifiablePactMessages.new(verifiable_pact, pact_url)

  notices = []

  if options[:deprecated]
    append_notice(notices, "before_verification", "WARNING - this version of the Pact library uses a beta version of the API which will be removed in the future. Please upgrade your Pact library. See https://docs.pact.io/pact_broker/advanced_topics/provider_verification_results/#pacts-for-verification for minimum required versions.")
  end

  append_notice(notices, "before_verification", messages.inclusion_reason)

  if options[:include_pending_status]
    append_notice(notices, "before_verification", messages.pending_reason)
    append_notice(notices, "after_verification:success_true_published_false", messages.verification_success_true_published_false)
    append_notice(notices, "after_verification:success_false_published_false", messages.verification_success_false_published_false)
    append_notice(notices, "after_verification:success_true_published_true", messages.verification_success_true_published_true)
    append_notice(notices, "after_verification:success_false_published_true", messages.verification_success_false_published_true)
  end
  notices
end