about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-17 22:42:55 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-17 22:42:55 -0700
commit7a3ebef424f3e7db0a48ae35885c446d79b7d971 (patch)
treef5cbaa3cd99833ed39a5076a580d20a1d978f27f
parent08c52c81bc49023a645dd211c4c983a60ac64e13 (diff)
downloadrainbows-7a3ebef424f3e7db0a48ae35885c446d79b7d971.tar.gz
Since we export "rainbows.model" to Rack now, we don't
have to worry about setting the "SLEEP_CLASS" env for
the application.
-rw-r--r--t/sleep.ru13
-rwxr-xr-xt/t3002-revactor-graceful.sh2
-rwxr-xr-xt/t3003-revactor-reopen-logs.sh2
3 files changed, 11 insertions, 6 deletions
diff --git a/t/sleep.ru b/t/sleep.ru
index 66b29af..8b3499b 100644
--- a/t/sleep.ru
+++ b/t/sleep.ru
@@ -1,11 +1,16 @@
 use Rack::ContentLength
 use Rack::ContentType
-sleep_class = ENV['SLEEP_CLASS']
-sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel
-$stderr.puts "sleep_class=#{sleep_class.inspect}"
+
 run lambda { |env|
   nr = 1
   env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f
-  sleep_class.sleep(nr)
+
+  (case env['rainbows.model']
+  when :Revactor
+    Actor
+  else
+    Kernel
+  end).sleep(nr)
+
   [ 200, {}, [ "Hello\n" ] ]
 }
diff --git a/t/t3002-revactor-graceful.sh b/t/t3002-revactor-graceful.sh
index 2a766be..67c6ba3 100755
--- a/t/t3002-revactor-graceful.sh
+++ b/t/t3002-revactor-graceful.sh
@@ -17,7 +17,7 @@ Rainbows! do
 end
 EOF
 
-SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config
+rainbows -D sleep.ru -c $unicorn_config
 wait_for_pid $pid
 
 for i in $(awk "BEGIN{for(i=0;i<$nr_client;++i) print i}" </dev/null)
diff --git a/t/t3003-revactor-reopen-logs.sh b/t/t3003-revactor-reopen-logs.sh
index e39160f..8b11c19 100755
--- a/t/t3003-revactor-reopen-logs.sh
+++ b/t/t3003-revactor-reopen-logs.sh
@@ -19,7 +19,7 @@ Rainbows! do
 end
 EOF
 
-SLEEP_CLASS=Actor rainbows -D sleep.ru -c $unicorn_config
+rainbows -D sleep.ru -c $unicorn_config
 wait_for_pid $pid
 
 start=$(date +%s)