Created
December 30, 2020 14:48
-
-
Save barrettkingram/d806d85ef3f2f03b15932711786ffec1 to your computer and use it in GitHub Desktop.
Configuration to use unicorn with capybara
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
end | |
server.start.join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment