unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob 0a8894edc480216a2e476c788eadd7ebd0b983d2 643 bytes (raw)
$ git show v1.1.2:t/t0302-rails3-alt-working_directory.sh	# shows this blob on the CLI

 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
 
#!/bin/sh
. ./test-rails3.sh

t_plan 3 "Rails 3 (beta) inside alt working_directory (no config.ru)"

t_begin "setup and start" && {
	unicorn_setup
	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 -
	rm config.ru
	$RAKE db:sessions:create
	$RAKE db:migrate
	unicorn_setup
	rm $pid
	echo "working_directory '$t_pfx.app'" >> $unicorn_config
	cd /
	unicorn_rails -D -c $unicorn_config
	unicorn_wait_start
}

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

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

t_done

git clone https://yhbt.net/unicorn.git