1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Cleanup the binder ssl test

This commit is contained in:
Nate Berkopec 2020-03-07 07:34:35 -06:00
parent b5d7786b16
commit f31ce753b5
No known key found for this signature in database
GPG key ID: BDD7A4B8E43906A6

View file

@ -44,6 +44,23 @@ class TestBinder < TestBinderBase
refute_equal 0, port
end
def test_correct_zero_port_ssl
skip("Implement later")
ssl_regex = %r!ssl://127.0.0.1:(\d+)!
@binder.parse ["ssl://localhost:0?#{ssl_query}"], @events
stdout = @events.stdout.string
assert_match ssl_regex, stdout
port = ssl_regex.match(stdout)[1].to_i
refute_equal 0, port
if @binder.loopback_addresses.include? '::1'
assert_match %r!ssl://\[::1\]:(\d+)!, stdout
end
end
def test_logs_all_localhost_bindings
@binder.parse ["tcp://localhost:0"], @events
@ -53,21 +70,6 @@ class TestBinder < TestBinderBase
end
end
def test_correct_zero_port_ssl
skip("Implement in 4.3")
@binder.parse ["ssl://localhost:0?#{ssl_query}"], @events
stdout = @events.stdout.string
m = %r!tcp://127.0.0.1:(\d+)!.match(stdout)
port = m[1].to_i
refute_equal 0, port
assert_match %r!ssl://127.0.0.1:(\d+)!, stdout
if @binder.loopback_addresses.include? '::1'
assert_match %r!ssl://\[::1\]:(\d+)!, stdout
end
end
def test_allows_both_ssl_and_tcp
assert_parsing_logs_uri [:ssl, :tcp]
end