diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-07-19 10:10:05 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-07-19 17:04:35 -0700 |
commit | 0cd65fa1e01be369b270c72053cf21a3d6bcb45f (patch) | |
tree | 7ae76d0860f740838faa9cb5172b100b7a58a35c /t/t0031-close-pipe-response.sh | |
parent | ed14b9bdbb35fa18dc283ba2d048a33d10759b2d (diff) | |
download | rainbows-0cd65fa1e01be369b270c72053cf21a3d6bcb45f.tar.gz |
Some middlewares such as Clogger rely on wrapping the body having the close method called on it for logging.
Diffstat (limited to 't/t0031-close-pipe-response.sh')
-rw-r--r-- | t/t0031-close-pipe-response.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t0031-close-pipe-response.sh b/t/t0031-close-pipe-response.sh new file mode 100644 index 0000000..7439b5f --- /dev/null +++ b/t/t0031-close-pipe-response.sh @@ -0,0 +1,30 @@ +#!/bin/sh +. ./test-lib.sh + +t_plan 5 "close pipe response for $model" + +t_begin "setup and startup" && { + rtmpfiles err out + rainbows_setup $model + export fifo + rainbows -E none -D close-pipe-response.ru -c $unicorn_config + rainbows_wait_start +} + +t_begin "single request matches" && { + cat $fifo > $out & + test x'hello world' = x"$(curl -sSfv 2> $err http://$listen/)" +} + +t_begin "body.close called" && { + wait # for cat $fifo + grep CLOSING $out || die "body.close not logged" +} + +t_begin "shutdown server" && { + kill -QUIT $rainbows_pid +} + +t_begin "check stderr" && check_stderr + +t_done |