about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-14 18:36:05 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-14 18:36:05 -0700
commit93a718202947e7d742c8c25f326631de84b4e44e (patch)
tree2ab19b2e32c9cf0d417c4497446030e62b19fc4b
parent0836409458e674d701f2be6c26aa85d441959562 (diff)
downloadrainbows-93a718202947e7d742c8c25f326631de84b4e44e.tar.gz
Help ensure apps get the correct Rack environment to make
choices (if any) with.
-rw-r--r--t/t1000.ru6
-rw-r--r--t/t2000.ru6
-rw-r--r--t/t3000.ru6
-rw-r--r--t/t4000.ru8
4 files changed, 22 insertions, 4 deletions
diff --git a/t/t1000.ru b/t/t1000.ru
index e639023..4bb7348 100644
--- a/t/t1000.ru
+++ b/t/t1000.ru
@@ -2,5 +2,9 @@ use Rack::ContentLength
 use Rack::ContentType
 run lambda { |env|
   sleep 1
-  [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  if env['rack.multithread'] && env['rainbows.model'] == :ThreadPool
+    [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is not true"
+  end
 }
diff --git a/t/t2000.ru b/t/t2000.ru
index e639023..aa1accb 100644
--- a/t/t2000.ru
+++ b/t/t2000.ru
@@ -2,5 +2,9 @@ use Rack::ContentLength
 use Rack::ContentType
 run lambda { |env|
   sleep 1
-  [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  if env['rack.multithread'] && env['rainbows.model'] == :ThreadSpawn
+    [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is not true"
+  end
 }
diff --git a/t/t3000.ru b/t/t3000.ru
index 7053c1a..9b9c56a 100644
--- a/t/t3000.ru
+++ b/t/t3000.ru
@@ -2,5 +2,9 @@ use Rack::ContentLength
 use Rack::ContentType
 run lambda { |env|
   Actor.sleep 1
-  [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  if env['rack.multithread'] == false && env['rainbows.model'] == :Revactor
+    [ 200, {}, [ Thread.current.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is true"
+  end
 }
diff --git a/t/t4000.ru b/t/t4000.ru
index c2355da..a3e2855 100644
--- a/t/t4000.ru
+++ b/t/t4000.ru
@@ -1,3 +1,9 @@
 use Rack::ContentLength
 use Rack::ContentType
-run lambda { |env| [ 200, {}, [ env.inspect << "\n" ] ] }
+run lambda { |env|
+  if env['rack.multithread'] == false && env['rainbows.model'] == :Rev
+    [ 200, {}, [ env.inspect << "\n" ] ]
+  else
+    raise "rack.multithread is true"
+  end
+}