class Pact::Consumer::Configuration::ServiceProvider
Attributes
consumer_name[RW]
name[RW]
service[RW]
Public Class Methods
new(name, consumer_name)
click to toggle source
# File lib/pact/consumer/configuration/service_provider.rb, line 13 def initialize name, consumer_name @name = name @service = nil @consumer_name = consumer_name end
Public Instance Methods
finalize()
click to toggle source
# File lib/pact/consumer/configuration/service_provider.rb, line 25 def finalize validate end
mock_service(name, &block)
click to toggle source
# File lib/pact/consumer/configuration/service_provider.rb, line 20 def mock_service name, &block self.service = MockService.build(name, consumer_name, self.name, &block) end
Private Instance Methods
validate()
click to toggle source
# File lib/pact/consumer/configuration/service_provider.rb, line 31 def validate raise "Please configure a service for #{name}" unless service end