-
Notifications
You must be signed in to change notification settings - Fork 218
/
Copy pathcommand-env.t
38 lines (30 loc) · 955 Bytes
/
command-env.t
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
#!/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 File::Path::Tiny;
use Test::Spec;
use Test::Output;
mock_perlbrew_install("perl-5.14.1");
describe "env command," => sub {
describe "when invoked with a perl installation name", sub {
it "displays environment variables that should be set to use the given perl." => sub {
my $app = App::perlbrew->new("env", "perl-5.14.1");
stdout_is {
$app->run;
} <<"OUT";
export PERLBREW_PERL=perl-5.14.1
export PERLBREW_VERSION=$App::perlbrew::VERSION
export PERLBREW_PATH=$App::perlbrew::PERLBREW_ROOT/bin:$App::perlbrew::PERLBREW_ROOT/perls/perl-5.14.1/bin
export PERLBREW_ROOT=$App::perlbrew::PERLBREW_ROOT
OUT
};
};
};
runtests unless caller;