4 t_plan
5 "Rails 3 (beta) inside alt working_directory (no embedded switches)"
6 t_begin
"setup and start" && {
8 rtmpfiles unicorn_config_tmp usock
10 rails3_app
=$
(cd rails3-app
&& pwd)
14 ( cd $rails3_app && tar cf
- .
) |
tar xf
-
15 $RAKE db
:sessions
:create
20 grep -v ^pid
$unicorn_config > $unicorn_config_tmp
21 echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
23 unicorn_rails
-c $unicorn_config_tmp \
24 --daemonize --host $host --port $port -l $usock
27 t_begin
"pids in the right place" && {
30 die
"pid=$pid not expected"
33 unicorn_rails_pid
="$t_pfx.app/tmp/pids/unicorn.pid"
34 unicorn_pid
=$
(cat $unicorn_rails_pid)
37 t_begin
"static file serving works" && {
38 test x
"$(curl -sSf http://$listen/x.txt)" = xHELLO
41 t_begin
"socket created" && {
45 t_begin
"killing succeeds" && {