Class: Pact::Consumer::Configuration::MockService

Inherits:
Object
  • Object
show all
Extended by:
DSL
Defined in:
lib/pact/consumer/configuration/mock_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, consumer_name, provider_name) ⇒ MockService

Returns a new instance of MockService.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pact/consumer/configuration/mock_service.rb', line 16

def initialize name, consumer_name, provider_name
  @name = name
  @consumer_name = consumer_name
  @provider_name = provider_name
  @port = nil
  @host = "localhost"
  @standalone = false
  @verify = true
  @pact_specification_version = '2'
  @finalized = false
end

Instance Attribute Details

#consumer_nameObject

Returns the value of attribute consumer_name.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def consumer_name
  @consumer_name
end

#hostObject

Returns the value of attribute host.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def host
  @host
end

#pact_specification_versionObject

Returns the value of attribute pact_specification_version.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def pact_specification_version
  @pact_specification_version
end

#portObject

Returns the value of attribute port.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def port
  @port
end

#provider_nameObject

Returns the value of attribute provider_name.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def provider_name
  @provider_name
end

#standaloneObject

Returns the value of attribute standalone.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def standalone
  @standalone
end

#verifyObject

Returns the value of attribute verify.



14
15
16
# File 'lib/pact/consumer/configuration/mock_service.rb', line 14

def verify
  @verify
end

Instance Method Details

#finalizeObject



50
51
52
53
54
55
# File 'lib/pact/consumer/configuration/mock_service.rb', line 50

def finalize
  raise 'Already finalized!' if @finalized
  register_mock_service
  configure_consumer_contract_builder
  @finalized = true
end