7 use lib "$FindBin::Bin/../../../lib";
9 use Test::More tests => 80;
10 use Catalyst::Test 'TestApp';
14 # test direct streaming
16 ok( my $response = request('http://localhost/streaming'), 'Request' );
17 ok( $response->is_success, 'Response Successful 2xx' );
18 is( $response->content_type, 'text/plain', 'Response Content-Type' );
19 is( $response->content,, <<'EOF', 'Content is a stream' );
26 # test streaming by passing a handle to $c->res->body
29 if ( $ENV{CATALYST_SERVER} ) {
30 skip "Using remote server", 4;
33 my $file = "$FindBin::Bin/../../../../01use.t";
34 my $fh = IO::File->new( $file, 'r' );
37 $fh->read( $buffer, 1024 );
41 ok( my $response = request('http://localhost/action/streaming/body'),
43 ok( $response->is_success, 'Response Successful 2xx' );
44 is( $response->content_type, 'text/plain', 'Response Content-Type' );
45 is( $response->content, $buffer, 'Content is read from filehandle' );