summaryrefslogtreecommitdiffhomepage
path: root/test/perl/body_io_fake/psgi.pl
diff options
context:
space:
mode:
authorAndrey Zelenkov <zelenkov@nginx.com>2019-01-28 17:16:50 +0300
committerAndrey Zelenkov <zelenkov@nginx.com>2019-01-28 17:16:50 +0300
commit7dddfe2143e28dcde147d8420f0bd129babaec3a (patch)
tree5aa0463318a82e026cb01f57b1169a02ff04f433 /test/perl/body_io_fake/psgi.pl
parenteced6bc97284478d67bfec04e204e4cd212167d9 (diff)
downloadunit-7dddfe2143e28dcde147d8420f0bd129babaec3a.tar.gz
unit-7dddfe2143e28dcde147d8420f0bd129babaec3a.tar.bz2
Tests: added test for reading body from IO::Handle-like object.
Diffstat (limited to '')
-rw-r--r--test/perl/body_io_fake/psgi.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/perl/body_io_fake/psgi.pl b/test/perl/body_io_fake/psgi.pl
new file mode 100644
index 00000000..6990bfaf
--- /dev/null
+++ b/test/perl/body_io_fake/psgi.pl
@@ -0,0 +1,11 @@
+use File::Basename;
+use lib dirname (__FILE__);
+use IOFake;
+
+my $app = sub {
+ my ($environ) = @_;
+
+ my $io = IOFake->new($environ->{'psgi.errors'});
+
+ return ['200', [ 'Content-Length' => '2' ], $io];
+};