Sha256: 8b32232a0208a9ac52582dbee872a4b5d0555f50768bad1eadca66de52e63d25

Contents?: true

Size: 937 Bytes

Versions: 2

Compression:

Stored size: 937 Bytes

Contents

require'pact/provider/verification_results/create'
require'pact/provider/verification_results/publish'

module Pact
  module Provider
    module VerificationResults
      class PublishAll

        def self.call pact_sources, rspec_summary
          new(pact_sources, rspec_summary).call
        end

        def initialize pact_sources, rspec_summary
          @pact_sources = pact_sources
          @rspec_summary = rspec_summary
        end

        # TODO do not publish unless all interactions have been run
        def call
          verification_results.collect do | pair |
            Publish.call(pair.first, pair.last)
          end
        end

        private

        def verification_results
          pact_sources.collect do | pact_source |
            [pact_source, Create.call(pact_source.pact_json, rspec_summary)]
          end
        end

        attr_reader :pact_sources, :rspec_summary
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pact-1.19.1 lib/pact/provider/verification_results/publish_all.rb
pact-1.19.0 lib/pact/provider/verification_results/publish_all.rb