Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move TestRequest to test/

darcs-hash:20070228191254-4fc50-42c88e9d6f28ad0390f74ca1867af3da76ed7620.gz
  • Loading branch information...
commit be41d90160c7d40b5efe1be1fe37e62c45f319f9 1 parent b88db13
@chneukirchen authored
View
2  test/cgi/test
@@ -4,6 +4,6 @@
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
require 'rack'
-require 'rack/testrequest'
+require '../testrequest'
Rack::Handler::CGI.run(Rack::Lint.new(TestRequest.new))
View
2  test/cgi/test.fcgi
@@ -4,6 +4,6 @@
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
require 'rack'
-require 'rack/testrequest'
+require '../testrequest'
Rack::Handler::FastCGI.run(Rack::Lint.new(TestRequest.new))
View
2  test/cgi/test.ru
@@ -2,6 +2,6 @@
#\ -E deployment -I ~/projects/rack/lib
# -*- ruby -*-
-require 'rack/testrequest'
+require '../testrequest'
run TestRequest.new
View
2  test/spec_rack_cgi.rb
@@ -1,5 +1,5 @@
require 'test/spec'
-require 'rack/testrequest'
+require 'testrequest'
pid = fork {
exec "cd #{File.join(File.dirname(__FILE__), 'cgi')} && lighttpd -D -f lighttpd.conf"
View
2  test/spec_rack_fastcgi.rb
@@ -1,5 +1,5 @@
require 'test/spec'
-require 'rack/testrequest'
+require 'testrequest'
pid = fork {
exec "cd #{File.join(File.dirname(__FILE__), 'cgi')} && lighttpd -D -f lighttpd.conf"
View
2  test/spec_rack_mongrel.rb
@@ -2,7 +2,7 @@
require 'rack/handler/mongrel'
require 'rack/lint'
-require 'rack/testrequest'
+require 'testrequest'
Thread.abort_on_exception = true
$tcp_defer_accept_opts = nil
View
2  test/spec_rack_webrick.rb
@@ -2,7 +2,7 @@
require 'rack/handler/webrick'
require 'rack/lint'
-require 'rack/testrequest'
+require 'testrequest'
Thread.abort_on_exception = true
View
23 lib/rack/testrequest.rb → test/testrequest.rb
@@ -2,29 +2,6 @@
require 'net/http'
class TestRequest
- TEST_ENV = {
- "REQUEST_METHOD" => "GET",
- "SERVER_NAME" => "example.org",
- "SERVER_PORT" => "8080",
- "QUERY_STRING" => "",
- "rack.version" => [0,1],
- "rack.input" => StringIO.new,
- "rack.errors" => StringIO.new,
- "rack.multithread" => true,
- "rack.multiprocess" => true,
- "rack.run_once" => false,
- "rack.url_scheme" => "http",
- "PATH_INFO" => "/",
- }
-
- def self.env(modifier)
- e = TEST_ENV.dup
- e.update modifier
- e.delete_if { |k, v| v.nil? }
- e
- end
-
-
def call(env)
status = env["QUERY_STRING"] =~ /secret/ ? 403 : 200
env["test.postdata"] = env["rack.input"].read
Please sign in to comment.
Something went wrong with that request. Please try again.