Pod-Cpandoc-Cache

 view release on metacpan or  search on metacpan

t/01_basic.t  view on Meta::CPAN

}


$ENV{POD_CPANDOC_CACHE_ROOT} = tempdir( CLEANUP => 1 );
diag($ENV{POD_CPANDOC_CACHE_ROOT});
my @stat_tmpdir = stat $ENV{POD_CPANDOC_CACHE_ROOT};
diag("@stat_tmpdir");


subtest 'no option or -m' => sub {
    local @ARGV = ('Acme::No');
    my ($stdout, $stderr, $exit)  = capture {
        Pod::Cpandoc::Cache->run();
    };
    diag ("$stderr, $exit");


    ok( -f catfile($ENV{POD_CPANDOC_CACHE_ROOT}, 'Acme', 'No.pm'), '-f cache_path'  );

    ok(Pod::Cpandoc::Cache->new->search_from_cache('Acme::No'), 'serach_from_cache');
};

t/02_opt_c.t  view on Meta::CPAN

use warnings;
use Pod::Cpandoc::Cache;
use File::Spec::Functions qw(catfile catdir);
use Capture::Tiny qw/ capture /;
use Cwd();
use File::Temp qw/ tempdir /;

$ENV{POD_CPANDOC_CACHE_ROOT} = tempdir( CLEANUP => 1 );

subtest '-c option' => sub {
    local @ARGV = ('-c','Acme::No');
    my ($stdout, $stderr, $exit)  = capture {
        Pod::Cpandoc::Cache->new->run();
    };
    diag ("$stderr, $exit");

    ok( -f catfile($ENV{POD_CPANDOC_CACHE_ROOT}, 'Acme', 'No.txt'), '-f cache_path'  );
};

done_testing;



( run in 1.438 second using v1.01-cache-2.11-cpan-49f99fa48dc )