1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Raise error if puma version is lower than 3.8.0

This commit is contained in:
Hieu Nguyen 2018-09-06 11:20:59 +07:00
parent 6d470ba90f
commit a147576660

View file

@ -448,6 +448,10 @@ Capybara.register_server :puma do |app, port, host, **options|
require 'rack/handler/puma'
rescue LoadError
raise LoadError, 'Capybara is unable to load `puma` for its server, please add `puma` to your project or specify a different server via something like `Capybara.server = :webrick`.'
else
unless Rack::Handler::Puma.respond_to?(:config)
raise LoadError, 'Capybara requires `puma` version 3.8.0 or higher, please upgrade `puma` or register and specify your own server block'
end
end
# If we just run the Puma Rack handler it installs signal handlers which prevent us from being able to interrupt tests.
# Therefore construct and run the Server instance ourselves.