test/spec_cgi.rb in rack-1.2.8 vs test/spec_cgi.rb in rack-1.3.0.beta
- old
+ new
@@ -1,14 +1,19 @@
+begin
require File.expand_path('../testrequest', __FILE__)
require 'rack/handler/cgi'
describe Rack::Handler::CGI do
extend TestRequest::Helpers
@host = '0.0.0.0'
@port = 9203
+ if `which lighttpd` && !$?.success?
+ raise "lighttpd not found"
+ end
+
# Keep this first.
$pid = fork {
ENV['RACK_ENV'] = 'deployment'
ENV['RUBYLIB'] = [
File.expand_path('../../lib', __FILE__),
@@ -86,6 +91,12 @@
# Keep this last.
should "shutdown" do
Process.kill 15, $pid
Process.wait($pid).should == $pid
end
+end
+
+rescue RuntimeError
+ $stderr.puts "Skipping Rack::Handler::CGI tests (lighttpd is required). Install lighttpd and try again."
+rescue NotImplementedError
+ $stderr.puts "Your Ruby implemenation or platform does not support fork. Skipping Rack::Handler::CGI tests."
end