mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Update default puma server registration to try to ensure single mode
This commit is contained in:
parent
be9318c3ae
commit
13be782a1a
3 changed files with 18 additions and 1 deletions
|
@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|||
s.add_development_dependency("cucumber", [">= 0.10.5"])
|
||||
s.add_development_dependency("minitest")
|
||||
s.add_development_dependency("rake")
|
||||
s.add_development_dependency("puma")
|
||||
s.add_development_dependency("pry")
|
||||
s.add_development_dependency("erubi") # dependency specification needed by rbx
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ end
|
|||
|
||||
Capybara.register_server :puma do |app, port, host|
|
||||
require 'rack/handler/puma'
|
||||
Rack::Handler::Puma.run(app, Host: host, Port: port, Threads: "0:4")
|
||||
Rack::Handler::Puma.run(app, Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false)
|
||||
end
|
||||
|
||||
Capybara.configure do |config|
|
||||
|
|
|
@ -79,6 +79,22 @@ RSpec.describe Capybara do
|
|||
Capybara.server(&server)
|
||||
expect(Capybara.server).to eq(server)
|
||||
end
|
||||
|
||||
it "should have :webrick registered" do
|
||||
require 'rack/handler/webrick'
|
||||
mock_app = double('app')
|
||||
Capybara.server = :webrick
|
||||
expect(Rack::Handler::WEBrick).to receive(:run)
|
||||
Capybara.server.call(mock_app, 8000)
|
||||
end
|
||||
|
||||
it "should have :puma registered" do
|
||||
require 'rack/handler/puma'
|
||||
mock_app = double('app')
|
||||
Capybara.server = :puma
|
||||
expect(Rack::Handler::Puma).to receive(:run)
|
||||
Capybara.server.call(mock_app, 8000)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'app_host' do
|
||||
|
|
Loading…
Reference in a new issue