mirrored from git://git.bogomips.org/unicorn.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: ensure -N/--no-default-middleware not supported in config.ru
Continue to make it easy to migrate AWAY from unicorn because vendor lock-in is the worst thing, especially if it's on us.
- Loading branch information
Eric Wong
committed
Sep 18, 2018
1 parent
47fddb5
commit c93a392
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
. ./test-lib.sh | ||
t_plan 3 "-N / --no-default-middleware option not supported in config.ru" | ||
|
||
t_begin "setup and start" && { | ||
unicorn_setup | ||
RACK_ENV=development unicorn -D -c $unicorn_config t0301.ru | ||
unicorn_wait_start | ||
} | ||
|
||
t_begin "check switches parsed as expected and -N ignored for Rack::Lint" && { | ||
debug=false | ||
lint= | ||
eval "$(curl -sf http://$listen/vars)" | ||
test x"$debug" = xtrue | ||
test x"$lint" != x | ||
test -f "$lint" | ||
} | ||
|
||
t_begin "killing succeeds" && { | ||
kill $unicorn_pid | ||
check_stderr | ||
} | ||
|
||
t_done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#\-N --debug | ||
run(lambda do |env| | ||
case env['PATH_INFO'] | ||
when '/vars' | ||
b = "debug=#{$DEBUG.inspect}\n" \ | ||
"lint=#{caller.grep(%r{rack/lint\.rb})[0].split(':')[0]}\n" | ||
end | ||
h = { | ||
'Content-Length' => b.size.to_s, | ||
'Content-Type' => 'text/plain', | ||
} | ||
[ 200, h, [ b ] ] | ||
end) |