diff options
Diffstat (limited to 'test/test_server.rb')
-rw-r--r-- | test/test_server.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_server.rb b/test/test_server.rb index e6ddefc..6b9f00f 100644 --- a/test/test_server.rb +++ b/test/test_server.rb @@ -408,6 +408,7 @@ class TestServer < Testcase app(:rack, ru) { listen "#{host}:#{port}" persistent_connections false + atfork_child { warn "INFO hihi from app.atfork_child" } } worker_processes(1) do atfork_child { puts "af #$$ worker is running" } @@ -430,6 +431,8 @@ class TestServer < Testcase lines = out.readlines.map!(&:chomp!) out.close! + assert_match %r{INFO hihi from app\.atfork_child}, File.read(err.path) + assert_equal 3, lines.size assert_equal("af #{pid} parent about to spawn", lines.shift) @@ -451,6 +454,7 @@ class TestServer < Testcase app(:rack, ru) { listen "#{host}:#{port}" persistent_connections false + atfork_child { |nr| warn "INFO hihi.#{nr} from app.atfork_child" } } worker_processes(1) do atfork_child { |nr| puts "af.#{nr} #$$ worker is running" } @@ -473,6 +477,7 @@ class TestServer < Testcase lines = out.readlines.map!(&:chomp!) out.close! + assert_match %r{INFO hihi\.0 from app\.atfork_child}, File.read(err.path) assert_equal 3, lines.size assert_equal("af.0 #{pid} parent about to spawn", lines.shift) |