Class: Pact::MockService::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/mock_service/run.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Run

Returns a new instance of Run.



16
17
18
# File 'lib/pact/mock_service/run.rb', line 16

def initialize options
  @options = options
end

Class Method Details

.call(options) ⇒ Object



12
13
14
# File 'lib/pact/mock_service/run.rb', line 12

def self.call options
  new(options).call
end

Instance Method Details

#callObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/pact/mock_service/run.rb', line 20

def call
  require 'pact/mock_service/app'

  trap(:INT) { call_shutdown_hooks  }
  trap(:TERM) { call_shutdown_hooks }

  require_monkeypatch

  Rack::Handler::WEBrick.run(mock_service, **webbrick_opts)
end