Added more documentation and tests
[catagits/HTTP-Request-AsCGI.git] / t / 04io.t
CommitLineData
12852959 1#!perl
2
3use Test::More tests => 3;
4
5use strict;
6use warnings;
7
17b370b0 8use IO::File;
12852959 9use HTTP::Request;
10use HTTP::Request::AsCGI;
11
12my $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 17my $c = HTTP::Request::AsCGI->new(
18 request => $r,
19 stderr => IO::File->new_tmpfile
20);
21
17b370b0 22$c->setup;
12852959 23
24print STDOUT 'STDOUT';
25print STDERR 'STDERR';
26
27$c->restore;
28
29is( $c->stdin->getline, 'STDIN', 'STDIN' );
30is( $c->stdout->getline, 'STDOUT', 'STDOUT' );
31is( $c->stderr->getline, 'STDERR', 'STDERR' );