Commit | Line | Data |
12852959 |
1 | #!perl |
2 | |
3 | use Test::More tests => 3; |
4 | |
5 | use strict; |
6 | use warnings; |
7 | |
17b370b0 |
8 | use IO::File; |
12852959 |
9 | use HTTP::Request; |
10 | use HTTP::Request::AsCGI; |
11 | |
12 | my $r = HTTP::Request->new( POST => 'http://www.host.com/'); |
13 | $r->content('STDIN'); |
14 | $r->content_length(5); |
15 | $r->content_type('text/plain'); |
16 | |
9c216915 |
17 | my $c = HTTP::Request::AsCGI->new( |
18 | request => $r, |
19 | stderr => IO::File->new_tmpfile |
20 | ); |
21 | |
17b370b0 |
22 | $c->setup; |
12852959 |
23 | |
24 | print STDOUT 'STDOUT'; |
25 | print STDERR 'STDERR'; |
26 | |
27 | $c->restore; |
28 | |
29 | is( $c->stdin->getline, 'STDIN', 'STDIN' ); |
30 | is( $c->stdout->getline, 'STDOUT', 'STDOUT' ); |
31 | is( $c->stderr->getline, 'STDERR', 'STDERR' ); |