+# ensure compatibility with other PSGI servers
+SKIP: {
+ require_mods(@zmods, qw(Plack::Test HTTP::Request::Common), 3);
+ use_ok 'HTTP::Request::Common';
+ use_ok 'Plack::Test';
+ STDERR->flush;
+ open my $olderr, '>&', \*STDERR or die "dup stderr: $!";
+ open my $tmperr, '+>', undef or die;
+ open STDERR, '>&', $tmperr or die;
+ STDERR->autoflush(1);
+ my $app = require $psgi;
+ test_psgi($app, sub {
+ my ($cb) = @_;
+ my $req = GET('http://example.com/psgi-return-gzip');
+ my $res = $cb->($req);
+ my $buf = $res->content;
+ IO::Uncompress::Gunzip::gunzip(\$buf => \(my $out));
+ is($out, "hello world\n", 'got expected output');
+
+ $req = GET('http://example.com/psgi-return-enoent');
+ $res = $cb->($req);
+ is($res->code, 500, 'got error on ENOENT');
+ seek($tmperr, 0, SEEK_SET) or die;
+ my $errbuf = do { local $/; <$tmperr> };
+ like($errbuf, qr/this-better-not-exist/,
+ 'error logged about missing command');
+ });
+ open STDERR, '>&', $olderr or die "restore stderr: $!";
+}
+