Sha256: 6161746ffe3069f9da668e0aa136ab1d1b35b0976a3a0442457173f58ac69875

Contents?: true

Size: 910 Bytes

Versions: 5

Compression:

Stored size: 910 Bytes

Contents

#!/bin/sh
. ./test-lib.sh
t_plan 6 "config variables conflict with preload_app"

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

	cat > $ru <<\EOF
use Rack::ContentLength
use Rack::ContentType, "text/plain"
config = ru = { "hello" => "world" }
run lambda { |env| [ 200, {}, [ ru.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 "modify rackup file" && {
	sed -e 's/world/WORLD/' < $ru > $rutmp
	mv $rutmp $ru
}

t_begin "reload signal succeeds" && {
	kill -HUP $rainbows_pid
	rainbows_wait_start
	wait_for_reload
	wait_for_reap
}

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

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

t_done

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rainbows-3.0.0 t/t0014-config-conflict.sh
rainbows-2.1.0 t/t0014-config-conflict.sh
rainbows-2.0.1 t/t0014-config-conflict.sh
rainbows-2.0.0 t/t0014-config-conflict.sh
rainbows-1.0.0 t/t0014-config-conflict.sh