protect @INC when re-invoking
[gitmo/MooseX-Runnable.git] / t / reverse-args.t
CommitLineData
2f7a7ff6 1use strict;
2use warnings;
3use Test::More tests => 1;
4
5use MooseX::Runnable::Util::ArgParser;
6
7my $str = '-MFoo -Ilib -MBar +Plugout +Plugin --with-args -- MyApp --with args';
8
9my $args = MooseX::Runnable::Util::ArgParser->new(
10 argv => [split ' ', $str],
11);
12
13local $^X = '/path/to/perl';
14local $FindBin::Bin = '/path/to';
15local $FindBin::Script = 'mx-run';
69fbdb1a 16local @INC = ('foobar');
2f7a7ff6 17my @cmdline = $args->guess_cmdline(
18 perl_flags => ['--X--'],
19 without_plugins => ['Plugout'],
20);
21
22is join(' ', @cmdline),
69fbdb1a 23 "/path/to/perl -Ifoobar --X-- /path/to/mx-run -Ilib -MFoo -MBar +Plugin --with-args -- MyApp --with args",
2f7a7ff6 24 'cmdline reverses reasonably';