summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-11-16 20:49:11 +0900
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2019-11-16 21:00:56 +0900
commit36cffbdb7ff1fcaa852a6cfc2f96bbac59ec161d (patch)
tree1fb11edddc2047df3b02ebb14a7045da4dcdfe75
parent2faa88c48d020ca93d40c304905f207f21c7fec2 (diff)
downloadrack-36cffbdb7ff1fcaa852a6cfc2f96bbac59ec161d.tar.gz
Remove broken lighttpd specs.
-rwxr-xr-xtest/cgi/lighttpd.conf26
-rwxr-xr-xtest/cgi/test.fcgi9
-rw-r--r--test/helper.rb28
-rw-r--r--test/spec_cgi.rb86
-rw-r--r--test/spec_fastcgi.rb87
5 files changed, 0 insertions, 236 deletions
diff --git a/test/cgi/lighttpd.conf b/test/cgi/lighttpd.conf
deleted file mode 100755
index c195f78c..00000000
--- a/test/cgi/lighttpd.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-server.modules = ("mod_fastcgi", "mod_cgi")
-server.document-root = "."
-server.errorlog = var.CWD + "/lighttpd.errors"
-server.port = 9203
-server.bind = "127.0.0.1"
-
-server.event-handler = "select"
-
-cgi.assign = ("/test" => "",
-# ".ru" => ""
- )
-
-fastcgi.server = (
- "test.fcgi" => ("localhost" =>
- ("min-procs" => 1,
- "socket" => "/tmp/rack-test-fcgi",
- "bin-path" => "test.fcgi")),
- "test.ru" => ("localhost" =>
- ("min-procs" => 1,
- "socket" => "/tmp/rack-test-ru-fcgi",
- "bin-path" => CWD + "/rackup_stub.rb test.ru")),
- "sample_rackup.ru" => ("localhost" =>
- ("min-procs" => 1,
- "socket" => "/tmp/rack-test-rackup-fcgi",
- "bin-path" => CWD + "/rackup_stub.rb sample_rackup.ru")),
- )
diff --git a/test/cgi/test.fcgi b/test/cgi/test.fcgi
deleted file mode 100755
index a67e547a..00000000
--- a/test/cgi/test.fcgi
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-# frozen_string_literal: true
-
-require 'uri'
-$:.unshift '../../lib'
-require 'rack'
-require '../testrequest'
-
-Rack::Handler::FastCGI.run(Rack::Lint.new(TestRequest.new))
diff --git a/test/helper.rb b/test/helper.rb
index dff89558..38f7df40 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -4,33 +4,5 @@ require 'minitest/global_expectations/autorun'
module Rack
class TestCase < Minitest::Test
- # Check for Lighttpd and launch it for tests if available.
- `which lighttpd`
-
- if $?.success?
- begin
- # Keep this first.
- LIGHTTPD_PID = fork {
- ENV['RACK_ENV'] = 'deployment'
- ENV['RUBYLIB'] = [
- ::File.expand_path('../../lib', __FILE__),
- ENV['RUBYLIB'],
- ].compact.join(':')
-
- Dir.chdir(::File.expand_path("../cgi", __FILE__)) do
- exec "lighttpd -D -f lighttpd.conf"
- end
- }
- rescue NotImplementedError
- warn "Your Ruby doesn't support Kernel#fork. Skipping Rack::Handler::CGI and ::FastCGI tests."
- else
- Minitest.after_run do
- Process.kill 15, LIGHTTPD_PID
- Process.wait LIGHTTPD_PID
- end
- end
- else
- warn "Lighttpd isn't installed. Skipping Rack::Handler::CGI and FastCGI tests. Install lighttpd to run them."
- end
end
end
diff --git a/test/spec_cgi.rb b/test/spec_cgi.rb
deleted file mode 100644
index 8d48e999..00000000
--- a/test/spec_cgi.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-require 'helper'
-
-if defined? Rack::TestCase::LIGHTTPD_PID
-
-require File.expand_path('../testrequest', __FILE__)
-require 'rack/handler/cgi'
-
-describe Rack::Handler::CGI do
- include TestRequest::Helpers
-
- before do
- @host = '127.0.0.1'
- @port = 9203
- end
-
- if `which lighttpd` && !$?.success?
- raise "lighttpd not found"
- end
-
- it "respond" do
- sleep 1
- GET("/test")
- response.wont_be :nil?
- end
-
- it "be a lighttpd" do
- GET("/test")
- status.must_equal 200
- response["SERVER_SOFTWARE"].must_match(/lighttpd/)
- response["HTTP_VERSION"].must_equal "HTTP/1.1"
- response["SERVER_PROTOCOL"].must_equal "HTTP/1.1"
- response["SERVER_PORT"].must_equal @port.to_s
- response["SERVER_NAME"].must_equal @host
- end
-
- it "have rack headers" do
- GET("/test")
- response["rack.version"].must_equal [1, 3]
- assert_equal false, response["rack.multithread"]
- assert_equal true, response["rack.multiprocess"]
- assert_equal true, response["rack.run_once"]
- end
-
- it "have CGI headers on GET" do
- GET("/test")
- response["REQUEST_METHOD"].must_equal "GET"
- response["SCRIPT_NAME"].must_equal "/test"
- response["REQUEST_PATH"].must_equal "/"
- response["PATH_INFO"].must_be_nil
- response["QUERY_STRING"].must_equal ""
- response["test.postdata"].must_equal ""
-
- GET("/test/foo?quux=1")
- response["REQUEST_METHOD"].must_equal "GET"
- response["SCRIPT_NAME"].must_equal "/test"
- response["REQUEST_PATH"].must_equal "/"
- response["PATH_INFO"].must_equal "/foo"
- response["QUERY_STRING"].must_equal "quux=1"
- end
-
- it "have CGI headers on POST" do
- POST("/test", { "rack-form-data" => "23" }, { 'X-test-header' => '42' })
- status.must_equal 200
- response["REQUEST_METHOD"].must_equal "POST"
- response["SCRIPT_NAME"].must_equal "/test"
- response["REQUEST_PATH"].must_equal "/"
- response["QUERY_STRING"].must_equal ""
- response["HTTP_X_TEST_HEADER"].must_equal "42"
- response["test.postdata"].must_equal "rack-form-data=23"
- end
-
- it "support HTTP auth" do
- GET("/test", { user: "ruth", passwd: "secret" })
- response["HTTP_AUTHORIZATION"].must_equal "Basic cnV0aDpzZWNyZXQ="
- end
-
- it "set status" do
- GET("/test?secret")
- status.must_equal 403
- response["rack.url_scheme"].must_equal "http"
- end
-end
-
-end # if defined? Rack::TestCase::LIGHTTPD_PID
diff --git a/test/spec_fastcgi.rb b/test/spec_fastcgi.rb
deleted file mode 100644
index f3942076..00000000
--- a/test/spec_fastcgi.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-# frozen_string_literal: true
-
-require 'helper'
-
-if defined? Rack::TestCase::LIGHTTPD_PID
-
-require File.expand_path('../testrequest', __FILE__)
-require 'rack/handler/fastcgi'
-
-describe Rack::Handler::FastCGI do
- include TestRequest::Helpers
-
- before do
- @host = '127.0.0.1'
- @port = 9203
- end
-
- it "respond" do
- sleep 1
- GET("/test")
- response.wont_be :nil?
- end
-
- it "respond via rackup server" do
- GET("/sample_rackup.ru")
- status.must_equal 200
- end
-
- it "be a lighttpd" do
- GET("/test.fcgi")
- status.must_equal 200
- response["SERVER_SOFTWARE"].must_match(/lighttpd/)
- response["HTTP_VERSION"].must_equal "HTTP/1.1"
- response["SERVER_PROTOCOL"].must_equal "HTTP/1.1"
- response["SERVER_PORT"].must_equal @port.to_s
- response["SERVER_NAME"].must_equal @host
- end
-
- it "have rack headers" do
- GET("/test.fcgi")
- response["rack.version"].must_equal [1, 3]
- assert_equal false, response["rack.multithread"]
- assert_equal true, response["rack.multiprocess"]
- assert_equal false, response["rack.run_once"]
- end
-
- it "have CGI headers on GET" do
- GET("/test.fcgi")
- response["REQUEST_METHOD"].must_equal "GET"
- response["SCRIPT_NAME"].must_equal "/test.fcgi"
- response["REQUEST_PATH"].must_equal "/"
- response["PATH_INFO"].must_equal ""
- response["QUERY_STRING"].must_equal ""
- response["test.postdata"].must_equal ""
-
- GET("/test.fcgi/foo?quux=1")
- response["REQUEST_METHOD"].must_equal "GET"
- response["SCRIPT_NAME"].must_equal "/test.fcgi"
- response["REQUEST_PATH"].must_equal "/"
- response["PATH_INFO"].must_equal "/foo"
- response["QUERY_STRING"].must_equal "quux=1"
- end
-
- it "have CGI headers on POST" do
- POST("/test.fcgi", { "rack-form-data" => "23" }, { 'X-test-header' => '42' })
- status.must_equal 200
- response["REQUEST_METHOD"].must_equal "POST"
- response["SCRIPT_NAME"].must_equal "/test.fcgi"
- response["REQUEST_PATH"].must_equal "/"
- response["QUERY_STRING"].must_equal ""
- response["HTTP_X_TEST_HEADER"].must_equal "42"
- response["test.postdata"].must_equal "rack-form-data=23"
- end
-
- it "support HTTP auth" do
- GET("/test.fcgi", { user: "ruth", passwd: "secret" })
- response["HTTP_AUTHORIZATION"].must_equal "Basic cnV0aDpzZWNyZXQ="
- end
-
- it "set status" do
- GET("/test.fcgi?secret")
- status.must_equal 403
- response["rack.url_scheme"].must_equal "http"
- end
-end
-
-end # if defined? Rack::TestCase::LIGHTTPD_PID