From 65717ecbab432f4acd093d2efefd52bce66409d8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 2 Oct 2009 13:35:29 -0700 Subject: test_helper: unused_port rejects 8080 unconditionally Checking for addr to match the DEFAULT_HOST constant is wrong since having only 127.0.0.1:8080 will still prevent 0.0.0.0:8080 from being bound. --- test/test_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 3a3e42f..404bcb2 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -104,10 +104,8 @@ def unused_port(addr = '127.0.0.1') begin begin port = base + rand(32768 - base) - if addr == Unicorn::Const::DEFAULT_HOST - while port == Unicorn::Const::DEFAULT_PORT - port = base + rand(32768 - base) - end + while port == Unicorn::Const::DEFAULT_PORT + port = base + rand(32768 - base) end sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) -- cgit v1.2.3-24-ge0c7