File: installation3.t

package info (click to toggle)
perlbrew 0.78-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 708 kB
  • sloc: perl: 6,291; makefile: 6
file content (46 lines) | stat: -rwxr-xr-x 919 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env perl
use strict;
use warnings;

BEGIN {
    delete $ENV{PERLBREW_LIB};
}

use FindBin;
use lib $FindBin::Bin;
use App::perlbrew;
require 'test_helpers.pl';

use Test::More;

{
    no warnings 'redefine';

    sub App::perlbrew::available_perls {
        return map { "perl-$_" }
            qw<5.8.9 5.17.7 5.16.2 5.14.3 5.12.5 5.10.1>;
    }

    sub App::perlbrew::switch_to {
        shift->current_perl(shift);
    }
}

plan tests => 3;

{
    my $app = App::perlbrew->new("install", "--switch", "perl-stable");
    $app->run;

    my @installed = $app->installed_perls;
    is 0+@installed, 1, "install perl-stable installs one perl";

    is $installed[0]{name}, "perl-5.16.2",
        "install perl-stable installs correct perl";

    ok $installed[0]{is_current},
        "install --switch automatically switches to the installed perl"
            or diag explain $installed[0];
}

done_testing;