Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
nateberkopec committed Sep 26, 2019
1 parent fdcad03 commit f892e80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test_binder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_correct_zero_port_ssl
@binder.parse(["ssl://localhost:0?key=#{key}&cert=#{cert}"], @events)

stdout = @events.stdout.string
m = %r!tcp://127.0.0.1:(\d+)!.match(stdout)
m = %r!ssl://127.0.0.1:(\d+)!.match(stdout)
port = m[1].to_i

refute_equal 0, port
Expand All @@ -70,7 +70,12 @@ def test_correct_doublebind

stdout = @events.stdout.string

# Unsure of what to actually assert on here yet
%w[tcp ssl].each do |prot|
assert_match %r!#{prot}://127.0.0.1:(\d+)!, stdout
if @binder.loopback_addresses.include?("::1")
assert_match %r!#{prot}://\[::1\]:(\d+)!, stdout
end
end
end

def test_allows_both_unix_and_tcp
Expand Down

0 comments on commit f892e80

Please sign in to comment.