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 | |
b332ee65 |
17 | my $c = HTTP::Request::AsCGI->new($r); |
18 | $c->stderr(IO::File->new_tmpfile); |
17b370b0 |
19 | $c->setup; |
12852959 |
20 | |
21 | print STDOUT 'STDOUT'; |
22 | print STDERR 'STDERR'; |
23 | |
24 | $c->restore; |
25 | |
26 | is( $c->stdin->getline, 'STDIN', 'STDIN' ); |
27 | is( $c->stdout->getline, 'STDOUT', 'STDOUT' ); |
28 | is( $c->stderr->getline, 'STDERR', 'STDERR' ); |