Parrot::IO::Capture::Mini - capture messages printed to STDOUT or STDERR during Parrot testing
use Parrot::IO::Capture::Mini;
Tie STDOUT or STDERR.
STDOUT
STDERR
$tie = tie *STDERR, "Parrot::IO::Capture::Mini" or croak "Unable to tie";
Call a function which is likely to generate a warning or error message.
$self = Parrot::Ops2c::Utils->new( { argv => [ qw( CSwitch dan.ops dan.ops ) ], flag => { dynamic => 1 }, } );
Store what was captured in a variable, then untie.
untie
$msg = $tie->READLINE; untie *STDERR or croak "Unable to untie";
Use that variable in a test.
like($msg, qr/Ops file 'dan\.ops' mentioned more than once!/, "Got expected error message about mentioning same file twice");
This package provides the bare minimum level of functionality needed to capture messages printed to STDOUT or STDERR by Parrot build tools written in Perl 5.
Adapted by Jim Keenan from CPAN module IO::Capture::Tie_STDx. Thanks as always to the authors of IO::Capture, Mark Reynolds and Jon Morgan!
IO::Capture (http://search.cpan.org/dist/IO-Capture/).
To install Parrot::Op, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parrot::Op
CPAN shell
perl -MCPAN -e shell install Parrot::Op
For more information on module installation, please visit the detailed CPAN module installation guide.