summaryrefslogtreecommitdiff
path: root/test/rackup
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-11-21 10:30:58 -0800
committerJoshua Peek <josh@joshpeek.com>2009-11-21 10:30:58 -0800
commit87957c6c76f4f1cc9310667f71a4c15a3f35eb23 (patch)
tree67c416a2467ce0b567814f6e63384cc066a9df07 /test/rackup
parentc765e7b99f569c170f07431a6831541755e271f6 (diff)
downloadrack-87957c6c76f4f1cc9310667f71a4c15a3f35eb23.tar.gz
Test coverage for rackup
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'test/rackup')
-rw-r--r--test/rackup/config.ru25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/rackup/config.ru b/test/rackup/config.ru
new file mode 100644
index 00000000..2490c6ed
--- /dev/null
+++ b/test/rackup/config.ru
@@ -0,0 +1,25 @@
+require "#{File.dirname(__FILE__)}/../testrequest"
+
+$stderr = StringIO.new
+
+class EnvMiddleware
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ if env["PATH_INFO"] == "/broken_lint"
+ return [200, {}, ["Broken Lint"]]
+ end
+
+ env["test.$DEBUG"] = $DEBUG
+ env["test.$EVAL"] = BUKKIT if defined?(BUKKIT)
+ env["test.$VERBOSE"] = $VERBOSE
+ env["test.$LOAD_PATH"] = $LOAD_PATH
+ env["test.Ping"] = defined?(Ping)
+ @app.call(env)
+ end
+end
+
+use EnvMiddleware
+run TestRequest.new