File: current_shell.t

package info (click to toggle)
perlbrew 0.86-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 704 kB
  • sloc: perl: 8,459; makefile: 7; sh: 1
file content (23 lines) | stat: -rw-r--r-- 846 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use warnings;
use strict;
use Test::More tests => 6;
use App::perlbrew;

my $current_shell = (split("/", $ENV{SHELL}))[-1];
my $self = App::perlbrew->new();
is($self->current_shell(), $current_shell, 'current_shell gives the expected shell based on $SHELL environment variable') or diag("\$SHELL = $ENV{SHELL}");
is($self->current_shell('foobar'), 'foobar', 'current_shell setups and returns anything passed as parameter');

for my $shell (qw(bash zsh)) {
    note("Testing with $shell");
    $self->current_shell($shell);
    ok($self->current_shell_is_bashish(), 'current_shell_is_bashish() returns true if the current shell is Bash or based on it');
}


for my $shell (qw(ksh sh)) {
    note("Testing with $shell");
    $self->current_shell($shell);
    is($self->current_shell_is_bashish(), 0, 'current_shell_is_bashish() returns false');
}