about summary refs log tree commit homepage
path: root/test/unit/test_ws.rb
diff options
context:
space:
mode:
authorluislavena <luislavena@19e92222-5c0b-0410-8929-a290d50e31e9>2008-03-31 08:19:11 +0000
committerluislavena <luislavena@19e92222-5c0b-0410-8929-a290d50e31e9>2008-03-31 08:19:11 +0000
commiteda1ea00904dcf4b4e7ed533b327a842713ac11a (patch)
treebf6e839153592c22c2c2f9b4745b823c0b3db1f0 /test/unit/test_ws.rb
parent18e93c034db0c08bcc5b5f7a72a8fb6e909c009c (diff)
downloadunicorn-eda1ea00904dcf4b4e7ed533b327a842713ac11a.tar.gz
CI tools.
Use of #process_based_port as port number.
Exclude DirHandler(nil) with absolute paths on Windows.


git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/branches/stable_1-2@999 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'test/unit/test_ws.rb')
-rw-r--r--test/unit/test_ws.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/unit/test_ws.rb b/test/unit/test_ws.rb
index 68a79a8..9de8a45 100644
--- a/test/unit/test_ws.rb
+++ b/test/unit/test_ws.rb
@@ -22,10 +22,11 @@ class WebServerTest < Test::Unit::TestCase
 
   def setup
     @valid_request = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\n\r\n"
+    @port = process_based_port
     
     redirect_test_io do
       # We set num_processors=1 so that we can test the reaping code
-      @server = HttpServer.new("127.0.0.1", 9998, num_processors=1)
+      @server = HttpServer.new("127.0.0.1", @port, num_processors=1)
     end
     
     @tester = TestHandler.new
@@ -42,14 +43,14 @@ class WebServerTest < Test::Unit::TestCase
   end
 
   def test_simple_server
-    hit(['http://localhost:9998/test'])
+    hit(["http://localhost:#{@port}/test"])
     assert @tester.ran_test, "Handler didn't really run"
   end
 
 
   def do_test(string, chunk, close_after=nil, shutdown_delay=0)
     # Do not use instance variables here, because it needs to be thread safe
-    socket = TCPSocket.new("127.0.0.1", 9998);
+    socket = TCPSocket.new("127.0.0.1", @port);
     request = StringIO.new(string)
     chunks_out = 0