t/lib.perl: fix Perl integration tests w/o installation
[unicorn.git] / t / oob_gc.ru
blob2ae58a82e8cbaa5fa5f9f0c42a96499905810b2e
1 #\-E none
2 # frozen_string_literal: false
3 require 'unicorn/oob_gc'
4 use Rack::ContentLength
5 use Rack::ContentType, "text/plain"
6 use Unicorn::OobGC
7 $gc_started = false
9 # Mock GC.start
10 def GC.start
11   $gc_started = true
12 end
13 run lambda { |env|
14   if "/gc_reset" == env["PATH_INFO"] && "POST" == env["REQUEST_METHOD"]
15     $gc_started = false
16   end
17   [ 200, {}, [ "#$gc_started\n" ] ]