Rainbows! 2.1.0 - Cool.io, bugfixes and more!
[rainbows.git] / t / t0014-config-conflict.sh
blobb06c91507a7ca2d2a6cdb1e5e10b611dd24ed9c2
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 6 "config variables conflict with preload_app"
5 t_begin "setup and start" && {
6 rainbows_setup
7 rtmpfiles ru rutmp
9 cat > $ru <<\EOF
10 use Rack::ContentLength
11 use Rack::ContentType, "text/plain"
12 config = ru = { "hello" => "world" }
13 run lambda { |env| [ 200, {}, [ ru.inspect << "\n" ] ] }
14 EOF
15 echo 'preload_app true' >> $unicorn_config
16 rainbows -D -c $unicorn_config $ru
17 rainbows_wait_start
20 t_begin "hit with curl" && {
21 out=$(curl -sSf http://$listen/)
22 test x"$out" = x'{"hello"=>"world"}'
25 t_begin "modify rackup file" && {
26 sed -e 's/world/WORLD/' < $ru > $rutmp
27 mv $rutmp $ru
30 t_begin "reload signal succeeds" && {
31 kill -HUP $rainbows_pid
32 rainbows_wait_start
33 wait_for_reload
34 wait_for_reap
37 t_begin "hit with curl" && {
38 out=$(curl -sSf http://$listen/)
39 test x"$out" = x'{"hello"=>"WORLD"}'
42 t_begin "killing succeeds" && {
43 kill $rainbows_pid
46 t_done