summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-02 13:35:29 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-02 13:35:29 -0700
commit65717ecbab432f4acd093d2efefd52bce66409d8 (patch)
tree8c61186117b5db4858dd91a0048d66ac804c8f5b
parentcc6ffaf42307ab3bd072c58bd492fb5c5204e687 (diff)
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.
-rw-r--r--test/test_helper.rb6
1 files 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)