1use strict;
2use Test::More;
3use xt::CLI;
4
5my $cwd = Path::Tiny->cwd;
6
7{
8    my $app = cli();
9
10    $app->write_cpanfile(<<EOF);
11requires 'Hash::MultiValue';
12EOF
13
14    local $ENV{PERL_CARTON_MIRROR} = "$cwd/xt/mirror";
15    $app->run("install");
16
17    $app->run("list");
18    like $app->stdout, qr/^Hash-MultiValue-0.08/m;
19}
20
21{
22    # fallback to CPAN
23    my $app = cli();
24    $app->write_cpanfile(<<EOF);
25requires 'PSGI';
26EOF
27
28    local $ENV{PERL_CARTON_MIRROR} = "$cwd/xt/mirror";
29    $app->run("install");
30
31    $app->run("list");
32    like $app->stdout, qr/^PSGI-/m;
33}
34
35done_testing;
36
37
38
39