Module: Excon::Test::Plugin::Server::Puma

Defined in:
lib/excon/test/plugin/server/puma.rb

Instance Method Summary collapse

Instance Method Details

#start(app_str = app, bind_uri = bind) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/excon/test/plugin/server/puma.rb', line 6

def start(app_str = app, bind_uri = bind)
  open_process('puma', '-b', bind_uri.to_s, app_str)
  line = ''
  until line =~ /Use Ctrl-C to stop/
    line = read.gets
    fatal_time = elapsed_time > timeout
    raise 'puma server has taken too long to start' if fatal_time
  end
  true
end