From eda1ea00904dcf4b4e7ed533b327a842713ac11a Mon Sep 17 00:00:00 2001 From: luislavena Date: Mon, 31 Mar 2008 08:19:11 +0000 Subject: Remove fixed port numbers used in tests, make tests more friendly to 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 --- test/test_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/test_helper.rb') 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 -- cgit v1.2.3-24-ge0c7