bump dependencies for testing
[unicorn.git] / t / t0303-rails3-alt-working_directory_config.ru.sh
blob1433f941862e6a79d58685f56d06997624c9f267
1 #!/bin/sh
2 . ./test-rails3.sh
4 t_plan 5 "Rails 3 (beta) inside alt working_directory (w/ config.ru)"
6 t_begin "setup and start" && {
7 unicorn_setup
8 rtmpfiles unicorn_config_tmp usocket
9 if test -e $usocket
10 then
11 die "unexpected $usocket"
13 rails3_app=$(cd rails3-app && pwd)
14 rm -rf $t_pfx.app
15 mkdir $t_pfx.app
16 cd $t_pfx.app
17 ( cd $rails3_app && tar cf - . ) | tar xf -
18 $RAKE db:sessions:create
19 $RAKE db:migrate
20 unicorn_setup
21 rm $pid
23 echo "#\\--daemonize --host $host --port $port -l $usocket" \
24 >> $t_pfx.app/config.ru
26 # we have --host/--port in config.ru instead
27 grep -v ^listen $unicorn_config |
28 grep -v ^pid > $unicorn_config_tmp
29 echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
30 cd /
31 unicorn_rails -c $unicorn_config_tmp
34 t_begin "pids in the right place" && {
35 if test -e $pid
36 then
37 die "pid=$pid not expected"
40 unicorn_rails_pid="$t_pfx.app/tmp/pids/unicorn.pid"
41 unicorn_pid=$(cat $unicorn_rails_pid)
44 t_begin "static file serving works" && {
45 test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
48 t_begin "socket created" && {
49 test -S $usocket
52 t_begin "killing succeeds" && {
53 kill $unicorn_pid
56 t_done