File: do_system.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 (21 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More tests => 2;

# test that 'do_system' wraps 'system' correctly

our @system;
BEGIN {
  *CORE::GLOBAL::system = sub { @system = @_; };
}
use App::perlbrew;

# don't actually run() it, we just want to call do_system
my $app = App::perlbrew->new('list');

$app->do_system(qw(perl -E), 'say 42');
is_deeply \@system, [qw(perl -E), 'say 42'], 'passed all arguments to system()';

$app->do_system("perl -e 'say 42'");
is_deeply \@system, ["perl -e 'say 42'"], 'passed single string to system()';