Sha256: 9c71937ef059d9cb97f926629825f9d8a0cd8581d75d0a2cbf8520f12d5a67e2

Contents?: true

Size: 862 Bytes

Versions: 1

Compression:

Stored size: 862 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
evdispatch-0.4.2 test/test_helper.rb