in reply to Perl Test - Capture print statements
The following has worked well for me:
This stores whatever $app->run sends to STDOUT in $add_io.use IO::String; ... my $add_io = IO::String->new; my $old_handle = select($add_io); ok( $app->run, 'ran app' ); select($old_handle); like( ${$add_io->string_ref}, qr|Location:|, q|got application redirect| ); undef $add_io;
|
|---|