tests: make timeout tests reliable under 1.9
[rainbows.git] / t / t9000.ru
blobaf6b4fcd4579609b30ee859bd7617ab84865fcaf
1 use Rack::ContentLength
2 use Rack::ContentType
3 use Rainbows::AppPool, :size => ENV['APP_POOL_SIZE'].to_i
4 sleep_class = ENV['SLEEP_CLASS']
5 sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel
6 class Sleeper
7   def call(env)
8     sleep_class = ENV['SLEEP_CLASS']
9     sleep_class = sleep_class ? Object.const_get(sleep_class) : Kernel
10     sleep_class.sleep 1
11     [ 200, {}, [ "#{object_id}\n" ] ]
12   end
13 end
14 run Sleeper.new