App-opan
view release on metacpan or search on metacpan
use strictures 2;
use Test::More;
my $app = require "./script/opan";
my %descriptions = (
add => qr{Imports a distribution.*MY},
carton => qr{Starts a temporary server.*carton},
cpanm => qr{Starts a temporary server process and runs cpanm},
fetch => qr{Fetches 02packages.*PAN},
init => qr{Creates a pans/ directory.*},
merge => qr{Rebuilds the combined and nopin},
pin => qr{Fetches the file .* pinset},
pull => qr{Does a fetch and then a merge},
sub entries_for {
my ($pan) = @_;
App::opan::entries_from_packages_file($tempdir."/pans/${pan}/index");
}
sub App::opan::gmtime { 'TIME GOES HERE' }
subs->import::into('App::opan', 'gmtime');
my $app = require "./script/opan";
sub run {
local $CWD = $tempdir;
local $ENV{OPAN_MIRROR} = '/fakepan/';
my @args = @_;
my ($stdout, $stderr) = capture { $app->start(@args) };
diag("STDERR for ".join(' ', @args)." was\n".$stderr) if $stderr;
#is($stderr, '', 'No stderr output running '.join(' ', @args));
return $stdout;
}
PERL_MM_OPT PERL_MB_OPT
PASTHRU PASTHRU_DEFINE PASTHRU_INC
PREFIX INSTALL_BASE
PERL_LOCAL_LIB_ROOT
PERL_CPANM_OPT
MAKEFLAGS
)};
#use Data::Dumper; die Dumper \%ENV;
my $app = require "./script/opan";
my $orig_dir = $CWD;
{
rmtree my $wdir = 'xt/scratch';
mkpath $wdir;
local $CWD = $wdir;
$app->start('init');
$app->start(add => $orig_dir.'/t/fix/M-1.tar.gz');
$app->start('merge');
( run in 1.364 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )