require 'test/unit' $:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..','ext','revdispatch')) $:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..','lib')) require 'evdispatch' class TestServer def self.setup if !defined?($server_task) require 'rubygems' require 'daemons' # start up the test server require File.expand_path(File.join(File.dirname(__FILE__), '..','ext','revdispatch','server')) $server_task = Daemons.call do $daemonized = true begin require 'ebb' Ebb.start_server(TestApp.new, :port => TEST_PORT) rescue LoadError => e Rack::Handler::Mongrel.run(TestApp.new, :Port => TEST_PORT ) end end sleep(0.5) # wait for the server to start up at_exit { $server_task.stop } end end end