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.



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

def initialize options
  @options = options
end

Class Method Details

.call(options) ⇒ Object



9
10
11
# File 'lib/pact/mock_service/run.rb', line 9

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

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
# File 'lib/pact/mock_service/run.rb', line 17

def call
  require 'pact/mock_service/app'

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

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