Skip to content

Commit

Permalink
Add tests to test_puma_server.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed May 21, 2021
1 parent dce9964 commit f9fb3b1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/test_puma_server.rb
Expand Up @@ -304,7 +304,6 @@ def test_doesnt_print_backtrace_in_production
assert_match(/HTTP\/1.0 500 Internal Server Error/, data)
end


def test_eof_on_connection_close_is_not_logged_as_an_error
server_run

Expand Down Expand Up @@ -1312,4 +1311,24 @@ def test_drain_on_shutdown(drain=true)
def test_not_drain_on_shutdown
test_drain_on_shutdown false
end

def test_rack_url_scheme_dflt
server_run

data = send_http_and_read "GET / HTTP/1.0\r\n\r\n"
assert_equal "http", data.split("\r\n").last
end

def test_rack_url_scheme_user
@port = UniquePort.call
opts = { rack_url_scheme: 'user', binds: ["tcp://#{@host}:#{@port}"] }
conf = Puma::Configuration.new(opts).tap(&:clamp)
@server = Puma::Server.new @app, @events, conf.options
@server.inherit_binder Puma::Binder.new(@events, conf)
@server.binder.parse conf.options[:binds], @events
@server.run

data = send_http_and_read "GET / HTTP/1.0\r\n\r\n"
assert_equal "user", data.split("\r\n").last
end
end

0 comments on commit f9fb3b1

Please sign in to comment.