about summary refs log tree commit homepage
path: root/test/test_server.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-30 22:16:14 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-31 05:04:37 +0000
commitdee4be831cacbb8745b98b894c5e1ebc87078e2c (patch)
tree909e959ec5abc830aa21dba4346db9f578c44a1f /test/test_server.rb
parent602432714cd436b6f255e6ba6bc6fffbf5eca051 (diff)
downloadyahns-dee4be831cacbb8745b98b894c5e1ebc87078e2c.tar.gz
This should allow users to more-easily enable/disable apps
and their dependent atfork_* hooks.
Diffstat (limited to 'test/test_server.rb')
-rw-r--r--test/test_server.rb5
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)