Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/support/localhost_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def find_available_port
end

def boot
# Use WEBrick since it's part of the ruby standard library and is available on all ruby interpreters.
options = { :Port => port }
options.merge!(:AccessLog => [], :Logger => WEBrick::BasicLog.new(StringIO.new)) unless ENV['VERBOSE_SERVER']
Rackup::Handler::WEBrick.run(Identify.new(@rack_app), **options)
options.merge!(:AccessLog => [], :Logger => Rack::NullLogger.new(@rack_app)) unless ENV['VERBOSE_SERVER']
# This allows to use whatever web server is available. The Gemfile currently specifies WEBrick.
Rackup::Handler.default.run(Identify.new(@rack_app), **options)
end

def booted?
Expand All @@ -58,7 +58,7 @@ def booted?
def concurrently
if should_use_subprocess?
pid = Process.fork do
trap(:INT) { ::Rack::Handler::WEBrick.shutdown }
trap(:INT) { ::Rackup::Handler.default.shutdown }
yield
exit # manually exit; otherwise this sub-process will re-run the specs that haven't run yet.
end
Expand Down
Loading