Skip to content

Instantly share code, notes, and snippets.

View barrettkingram's full-sized avatar

Barrett Ingram barrettkingram

View GitHub Profile
@barrettkingram
barrettkingram / capybara_config.rb
Created December 30, 2020 14:48
Configuration to use unicorn with capybara
Capybara.register_server :unicorn do |app, port, host, **options|
rackup_opts = Unicorn::Configurator::RACKUP
rackup_opts[:host] = host
rackup_opts[:port] = port
rackup_opts[:set_listener] = true
server = Unicorn::HttpServer.new(app, rackup_opts[:options])
server.logger.level = :warn
at_exit do
trap(:CHLD, nil)
server.stop(false)