update test infrastructure to support Rubinius
[rainbows.git] / t / fork-sleep.ru
blob747a06d867f3c30e62123c12575f9f4ce512c6d6
1 #\-E none
2 # we do not want Rack::Lint or anything to protect us
3 use Rack::ContentLength
4 use Rack::ContentType, "text/plain"
5 trap(:CHLD) { $stderr.puts Process.waitpid2(-1).inspect }
6 map "/" do
7   time = ENV["nr"] || '15'
8   pid = fork { exec('sleep', time) }
9   run lambda { |env| [ 200, {}, [ "#{pid}\n" ] ] }
10 end