Sha256: f58e80ef654a23ceaccaee599225349bd520926157ac09526a620048e7185251

Contents?: true

Size: 1015 Bytes

Versions: 23

Compression:

Stored size: 1015 Bytes

Contents

require 'pact/provider/state/provider_state_proxy'

module Pact

  def self.provider_world
    @world ||= Pact::Provider::World.new
  end

  # internal api, for testing only
  def self.clear_provider_world
    @world = nil
  end

  module Provider
    class World

      attr_accessor :pact_sources

      def provider_states
        @provider_states_proxy ||= Pact::Provider::State::ProviderStateProxy.new
      end

      def add_pact_verification verification
        pact_verifications << verification
      end

      def pact_verifications
        @pact_verifications ||= []
      end

      def pact_urls
        (pact_verifications.collect(&:uri) + pact_uris_from_pact_uri_sources).compact
      end

      def add_pact_uri_source pact_uri_source
        pact_uri_sources << pact_uri_source
      end

      private

      def pact_uri_sources
        @pact_uri_sources ||= []
      end

      def pact_uris_from_pact_uri_sources
        pact_uri_sources.collect(&:call).flatten
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pact-1.55.1 lib/pact/provider/world.rb
pact-1.55.0 lib/pact/provider/world.rb
pact-1.54.0 lib/pact/provider/world.rb
pact-1.53.0 lib/pact/provider/world.rb
pact-1.52.0 lib/pact/provider/world.rb
pact-1.51.1 lib/pact/provider/world.rb
pact-1.51.0 lib/pact/provider/world.rb
pact-1.50.1 lib/pact/provider/world.rb
pact-1.50.0 lib/pact/provider/world.rb
pact-1.49.3 lib/pact/provider/world.rb
pact-1.49.2 lib/pact/provider/world.rb
pact-1.49.1 lib/pact/provider/world.rb
pact-1.49.0 lib/pact/provider/world.rb
pact-1.48.0 lib/pact/provider/world.rb
pact-1.47.0 lib/pact/provider/world.rb
pact-1.46.1 lib/pact/provider/world.rb
pact-1.46.0 lib/pact/provider/world.rb
pact-1.45.0 lib/pact/provider/world.rb
pact-1.44.1 lib/pact/provider/world.rb
pact-1.44.0 lib/pact/provider/world.rb