File: command-alias.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 (49 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download | duplicates (2)
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
47
48
49
#!/usr/bin/env perl
#!/usr/bin/env perl
use strict;
use warnings;

BEGIN { $ENV{SHELL} = "/bin/bash" }

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

use File::Temp qw( tempdir );
use File::Spec::Functions qw( catdir );
use Test::Spec;
use Test::Output;
use Config;

mock_perlbrew_install("perl-5.14.1");
mock_perlbrew_lib_create('perl-5.14.1@nobita');

describe "alias command," => sub {
    before each => sub {
        delete $ENV{PERL_MB_OPT};
        delete $ENV{PERL_MM_OPT};
        delete $ENV{PERL_LOCAL_LIB_ROOT};
        delete $ENV{PERLBREW_LIB};
        delete $ENV{PERL5LIB};
    };

    describe "when invoked with unknown action name,", sub {
        it "should display usage message" => sub {
            my $x   = "correcthorsebatterystaple";
            my $app = App::perlbrew->new("alias", $x);
            stderr_like {
                eval {
                    $app->run;
                    1;
                }
                or do {
                    print STDERR $@;
                };
            } qr/ERROR: Unrecognized action: `$x`/;

        }
    };
};

runtests unless caller;