Archer

 view release on metacpan or  search on metacpan

t/Util.pm  view on Meta::CPAN

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
our @EXPORT = qw/capture init $OUT $ERR is_valid_output/;
 
our $OUT;
our $ERR;
 
sub init {
    $FindBin::Bin .= "/.." if $FindBin::Bin !~ m!/\.\.!;
    $t::Plugin::Dummy::RUN_COUNTER = 0;
}
 
sub capture(&) {
    my $code = shift;
 
    $ERR = undef;
    $OUT = undef;
 
    tie *STDERR, 'IO::Scalar', \$ERR;
    tie *STDOUT, 'IO::Scalar', \$OUT;
 
        $code->();



( run in 0.226 second using v1.01-cache-2.11-cpan-cba739cd03b )