unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob c20ceef24a6648455cfe17f1d963c5c0562b8845 1052 bytes (raw)
$ git show v0.990.0:t/t0300-rails3-basic.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
#!/bin/sh
RAILS_VERSION=${RAILS_VERSION-3.0.0.beta3}

. ./test-lib.sh

case $RUBY_VERSION in
1.8.7|1.9.2) ;;
*)
	t_info "RUBY_VERSION=$RUBY_VERSION unsupported for Rails 3"
	exit 0
	;;
esac

arch_gems=../tmp/isolate/ruby-$RUBY_VERSION/gems
rails_gems=../tmp/isolate/rails-$RAILS_VERSION/gems
rails_bin="$rails_gems/rails-$RAILS_VERSION/bin/rails"
if ! test -d "$arch_gems" || ! test -d "$rails_gems" || ! test -x "$rails_bin"
then
	( cd ../ && $RAKE isolate )
fi

for i in $arch_gems/*-* $rails_gems/*-*
do
	if test -d $i/lib
	then
		RUBYLIB=$(cd $i/lib && pwd):$RUBYLIB
	fi
done

export RUBYLIB

t_plan 3 "Rails 3 (beta) tests"

t_begin "setup and start" && {
	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
	unicorn -D -c $unicorn_config
	unicorn_wait_start
}

# add more tests here
t_begin "hit with curl" && {
	curl -v http://$listen/ || :
}

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

t_done

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