Sha256: 57f976f0fdc1053bfb60deb2270e8171527581685f191143eda930abaac055ae

Contents?: true

Size: 1022 Bytes

Versions: 10

Compression:

Stored size: 1022 Bytes

Contents

#!/bin/sh
. ./test-lib.sh
t_plan 7 "reload config.ru error with preload_app true"

t_begin "setup and start" && {
	rainbows_setup
	rtmpfiles ru

	cat > $ru <<\EOF
use Rack::ContentLength
use Rack::ContentType, "text/plain"
x = { "hello" => "world" }
run lambda { |env| [ 200, {}, [ x.inspect << "\n" ] ] }
EOF
	echo 'preload_app true' >> $unicorn_config
	rainbows -D -c $unicorn_config $ru
	rainbows_wait_start
}

t_begin "hit with curl" && {
	out=$(curl -sSf http://$listen/)
	test x"$out" = x'{"hello"=>"world"}'
}

t_begin "introduce syntax error in rackup file" && {
	echo '...' >> $ru
}

t_begin "reload signal succeeds" && {
	kill -HUP $rainbows_pid
	rainbows_wait_start
	while ! egrep '(done|error) reloading' $r_err >/dev/null
	do
		sleep 1
	done

	grep 'error reloading' $r_err >/dev/null
	> $r_err
}

t_begin "hit with curl" && {
	out=$(curl -sSf http://$listen/)
	test x"$out" = x'{"hello"=>"world"}'
}

t_begin "killing succeeds" && {
	kill $rainbows_pid
}

t_begin "check stderr" && {
	check_stderr
}

t_done

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rainbows-1.0.0pre1 t/t0013-reload-bad-config.sh
rainbows-0.97.0 t/t0013-reload-bad-config.sh
rainbows-0.96.0 t/t0013-reload-bad-config.sh
rainbows-0.95.1 t/t0013-reload-bad-config.sh
rainbows-0.95.0 t/t0013-reload-bad-config.sh
rainbows-0.94.0 t/t0013-reload-bad-config.sh
rainbows-0.93.0 t/t0013-reload-bad-config.sh
rainbows-0.92.0 t/t0013-reload-bad-config.sh
rainbows-0.91.1 t/t0013-reload-bad-config.sh
rainbows-0.91.0 t/t0013-reload-bad-config.sh