rev: split out further into separate files for reuse
[rainbows.git] / t / t0006-process-rack-env.sh
blob7ee7c1535f16c438c4dfe02d82d3e66fcb71ab18
1 #!/bin/sh
2 . ./test-lib.sh
4 t_plan 4 'ensure ENV["RACK_ENV"] is set correctly for '$model
6 finish_checks () {
7 kill $rainbows_pid
8 test ! -s $curl_err
9 check_stderr
12 t_begin "setup" && {
13 rtmpfiles curl_out curl_err
16 t_begin "default RACK_ENV is 'development'" && {
17 rainbows_setup
18 rainbows -D -c $unicorn_config env_rack_env.ru
19 rainbows_wait_start
20 test x"$(curl -sSf http://$listen 2>$curl_err)" = x"development"
21 finish_checks
24 t_begin "RACK_ENV from process ENV is inherited" && {
25 rainbows_setup
26 ( RACK_ENV=production rainbows -D -c $unicorn_config env_rack_env.ru )
27 rainbows_wait_start
28 test x$(curl -sSf http://$listen 2>$curl_err) = x"production"
29 finish_checks
32 t_begin "RACK_ENV from -E is set" && {
33 rainbows_setup
34 rainbows -D -c $unicorn_config -E none env_rack_env.ru
35 rainbows_wait_start
36 test x$(curl -sSf http://$listen 2>$curl_err) = x"none"
37 finish_checks
40 t_done