From f31ce753b5b66d079b18c0e262013670ff75b808 Mon Sep 17 00:00:00 2001 From: Nate Berkopec Date: Sat, 7 Mar 2020 07:34:35 -0600 Subject: [PATCH] Cleanup the binder ssl test --- test/test_binder.rb | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/test/test_binder.rb b/test/test_binder.rb index 31189c4e..5a51225a 100644 --- a/test/test_binder.rb +++ b/test/test_binder.rb @@ -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