about summary refs log tree commit homepage
path: root/test/test_helper.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/test_helper.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/test_helper.rb')
-rw-r--r--test/test_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 42ead2c..7615fdd 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -64,3 +64,16 @@ def hit(uris)
 
   return results
 end
+
+# process_based_port provides a port number, usable for TCP and UDP  
+# connections based on $$ and with a 5000 as base.
+# this is required if you perform several builds of mongrel in parallel
+# (like continuous integration systems)
+def process_based_port
+  5000 + $$ % 1000
+end
+
+# Platform check helper ;-)
+def windows?
+  result = RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/
+end \ No newline at end of file