diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-11-21 10:30:58 -0800 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-11-21 10:30:58 -0800 |
commit | 87957c6c76f4f1cc9310667f71a4c15a3f35eb23 (patch) | |
tree | 67c416a2467ce0b567814f6e63384cc066a9df07 /test/rackup | |
parent | c765e7b99f569c170f07431a6831541755e271f6 (diff) | |
download | rack-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.ru | 25 |
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 |