Sha256: 3b469293a3e90866a2382393ff07e7ff90f11295bebd0a5483f8489a23921a61

Contents?: true

Size: 1.14 KB

Versions: 39

Compression:

Stored size: 1.14 KB

Contents

#!/bin/sh
. ./test-rails3.sh

t_plan 5 "Rails 3 (beta) inside alt working_directory (w/ config.ru)"

t_begin "setup and start" && {
	unicorn_setup
	rtmpfiles unicorn_config_tmp usocket
	if test -e $usocket
	then
		die "unexpected $usocket"
	fi
	rails3_app=$(cd rails3-app && pwd)
	rm -rf $t_pfx.app
	mkdir $t_pfx.app
	cd $t_pfx.app
	( cd $rails3_app && tar cf - . ) | tar xf -
	$RAKE db:sessions:create
	$RAKE db:migrate
	unicorn_setup
	rm $pid

	echo "#\\--daemonize --host $host --port $port -l $usocket" \
	     >> $t_pfx.app/config.ru

	# we have --host/--port in config.ru instead
	grep -v ^listen $unicorn_config |
	  grep -v ^pid > $unicorn_config_tmp
	echo "working_directory '$t_pfx.app'" >> $unicorn_config_tmp
	cd /
	unicorn_rails -c $unicorn_config_tmp
}

t_begin "pids in the right place" && {
	if test -e $pid
	then
		die "pid=$pid not expected"
	fi

	unicorn_rails_pid="$t_pfx.app/tmp/pids/unicorn.pid"
	unicorn_pid=$(cat $unicorn_rails_pid)
}

t_begin "static file serving works" && {
	test x"$(curl -sSf http://$listen/x.txt)" = xHELLO
}

t_begin "socket created" && {
	test -S $usocket
}

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

t_done

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
preplay_unicorn-4.3.1.5.ga7df t/t0303-rails3-alt-working_directory_config.ru.sh
preplay_unicorn-4.3.1.2.gc450 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-lb-patch-4.3.1.13.gb7d9 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-lb-patch-4.3.1.11.g21b8.dirty t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-heroku-4.3.1.1.gc608.dirty t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.3.1 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.3.0.2.g4551 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.3.0 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.2.1 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.2.0 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.1.1 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.1.0 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.0.1.4.g406b t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.0.1 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.0.0.2.g19f7 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-4.0.0 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-3.7.0 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-3.6.2 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-3.6.1 t/t0303-rails3-alt-working_directory_config.ru.sh
unicorn-3.6.0 t/t0303-rails3-alt-working_directory_config.ru.sh