Skip to content

Commit

Permalink
Rewrite tests to use cpanfile
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Apr 12, 2012
1 parent 76204cc commit 5a4c461
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
11 changes: 2 additions & 9 deletions xt/cli/check.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ use xt::CLI;
{
my $app = cli();

$app->dir->touch("Makefile.PL", <<EOF);
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => "foo",
VERSION => 1,
PREREQ_PM => {
"Try::Tiny" => 0,
},
);
$app->dir->touch("cpanfile", <<EOF);
requires 'Try::Tiny';
EOF

$app->run("check");
Expand Down
15 changes: 12 additions & 3 deletions xt/cli/exec.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ use xt::CLI;
$app->run("exec", "--system", "--", "perl", "-e", "use Try::Tiny");
like $app->system_error, qr/Can't locate Try\/Tiny.pm/;

$app->run("install", "Try::Tiny");
$app->dir->touch("cpanfile", <<EOF);
requires 'Try::Tiny';
EOF

$app->run("install");
$app->run("exec", "--system", "--", "perl", "-e", 'use Try::Tiny; print "OK\n"');

like $app->system_output, qr/OK/;

$app->run("install", "Mojolicious");
$app->run("exec", "--system", "--", "mojolicious", "version");
$app->dir->touch("cpanfile", <<EOF);
requires 'Try::Tiny';
requires 'Mojolicious';
EOF

$app->run("install");
$app->run("exec", "--system", "--", "mojo", "version");

like $app->system_output, qr/Mojolicious/;
}
Expand Down
6 changes: 5 additions & 1 deletion xt/cli/mirror.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ my $cwd = Cwd::cwd();
{
my $app = cli();

$app->dir->touch("cpanfile", <<EOF);
requires 'Hash::MultiValue';
EOF

$app->carton->{mirror} = "$cwd/xt/mirror";
$app->run("install", "Hash::MultiValue");
$app->run("install");

$app->run("list");
is $app->output, "Hash-MultiValue-0.08\n";
Expand Down

0 comments on commit 5a4c461

Please sign in to comment.