revert all changes since 0.5
[catagits/HTTP-Request-AsCGI.git] / t / 04io.t
1 #!perl
2
3 use Test::More tests => 3;
4
5 use strict;
6 use warnings;
7
8 use IO::File;
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
17 my $c = HTTP::Request::AsCGI->new($r);
18 $c->stderr(IO::File->new_tmpfile);
19 $c->setup;
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' );