about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-03-10 06:11:10 +0000
committerEric Wong <normalperson@yhbt.net>2011-03-10 06:11:10 +0000
commit8392f8186cd21f9190474bd6b5ac6ec58c7af96a (patch)
tree93784aad02a418f1203148f35bbbceded6e05925
parentb353e42e6f12f26a926bbb3202c8bb8e7a916d1c (diff)
downloadraindrops-8392f8186cd21f9190474bd6b5ac6ec58c7af96a.tar.gz
Oops, don't let GC close our listener before Unicorn
can inherit it.
-rw-r--r--test/test_middleware_unicorn.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_middleware_unicorn.rb b/test/test_middleware_unicorn.rb
index 7949f78..0a506e5 100644
--- a/test/test_middleware_unicorn.rb
+++ b/test/test_middleware_unicorn.rb
@@ -6,9 +6,9 @@ class TestMiddlewareUnicorn < Test::Unit::TestCase
 
   def setup
     @host = ENV["UNICORN_TEST_ADDR"] || "127.0.0.1"
-    sock = TCPServer.new @host, 0
-    @port = sock.addr[1]
-    ENV["UNICORN_FD"] = sock.fileno.to_s
+    @sock = TCPServer.new @host, 0
+    @port = @sock.addr[1]
+    ENV["UNICORN_FD"] = @sock.fileno.to_s
     @host_with_port = "#@host:#@port"
     @opts = { :listeners => [ @host_with_port ] }
     @addr_regexp = Regexp.escape @host_with_port