summary refs log tree commit homepage
path: root/t/t0006-process-rack-env.sh
blob: 7ee7c1535f16c438c4dfe02d82d3e66fcb71ab18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
. ./test-lib.sh

t_plan 4 'ensure ENV["RACK_ENV"] is set correctly for '$model

finish_checks () {
	kill $rainbows_pid
	test ! -s $curl_err
	check_stderr
}

t_begin "setup" && {
	rtmpfiles curl_out curl_err
}

t_begin "default RACK_ENV is 'development'" && {
	rainbows_setup
	rainbows -D -c $unicorn_config env_rack_env.ru
	rainbows_wait_start
	test x"$(curl -sSf http://$listen 2>$curl_err)" = x"development"
	finish_checks
}

t_begin "RACK_ENV from process ENV is inherited" && {
	rainbows_setup
	( RACK_ENV=production rainbows -D -c $unicorn_config env_rack_env.ru )
	rainbows_wait_start
	test x$(curl -sSf http://$listen 2>$curl_err) = x"production"
	finish_checks
}

t_begin "RACK_ENV from -E is set" && {
	rainbows_setup
	rainbows -D -c $unicorn_config -E none env_rack_env.ru
	rainbows_wait_start
	test x$(curl -sSf http://$listen 2>$curl_err) = x"none"
	finish_checks
}

t_done