Sha256: 6f7447baa8c9a726b3e31ff08508212b9a3b81d5cacdc8d205942b6177470036

Contents?: true

Size: 1.24 KB

Versions: 22

Compression:

Stored size: 1.24 KB

Contents

require 'pact_broker/pacts/verifiable_pact_messages'

module PactBroker
  module Pacts
    class BuildVerifiablePactNotices

      def self.call(verifiable_pact, pact_url, options)
        messages = VerifiablePactMessages.new(verifiable_pact, pact_url)

        notices = [{
          when: 'before_verification',
          text: 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

      def self.append_notice notices, the_when, text
        if text
          notices << {
            when: the_when,
            text: text
          }
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pact_broker-2.60.1 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.60.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.59.2 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.59.1 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.59.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.58.3 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.58.2 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.58.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.57.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.56.1 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.56.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.55.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.54.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.53.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.52.2 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.52.1 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.52.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.51.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.50.1 lib/pact_broker/pacts/build_verifiable_pact_notices.rb
pact_broker-2.50.0 lib/pact_broker/pacts/build_verifiable_pact_notices.rb