Sha256: 715690d1958a7b36e00a9c1afe0d6792183ab2a2048c23ff1c006bb68071ae39
Contents?: true
Size: 1 KB
Versions: 16
Compression:
Stored size: 1 KB
Contents
require 'pact/shared/dsl' module Pact module Consumer module Configuration class ServiceConsumer extend Pact::DSL attr_accessor :app, :port, :name def initialize name @name = name @app = nil @port = nil end dsl do def app app self.app = app end def port port self.port = port end def has_pact_with service_provider_name, &block ServiceProvider.build(service_provider_name, name, &block) end end def finalize validate register_consumer_app if @app end private def validate raise "Please provide a consumer name" unless (name && !name.empty?) raise "Please provide a port for the consumer app" if app && !port end def register_consumer_app Pact::Consumer::AppManager.instance.register app, port end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems