Skip to content

Commit

Permalink
exec command - test that format_info_output is actually called in rig…
Browse files Browse the repository at this point in the history
…ht context
  • Loading branch information
vsespb committed Jul 19, 2013
1 parent 3a39d2f commit e0b424d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion t/command-exec.t
Expand Up @@ -148,7 +148,21 @@ describe 'exec exit code' => sub {
Command [perl -E 'somesub 42'] terminated with exit code 7 (\$? = 1792) under the following perl environment:
format_info_output_value
OUT
}
};
it "should format info output for right perl" => sub {
my $app = App::perlbrew->new(qw(exec --with), "perl-5.14.1", qw(perl -E), "somesub 42");
$app->expects("format_info_output")->exactly(1)->returns(sub {
my ($self) = @_;
is $self->current_env, 'perl-5.14.1';
like $self->current_perl_executable, qr/perl-5.14.1/;
"format_info_output_value\n";
});
App::perlbrew->expects("do_exit_with_error_code")->exactly(1)->returns(sub {
die "simulate exit\n";
});
$app->expects("do_system_with_exit_code")->exactly(1)->returns(7<<8);
eval { $app->run; 1; };
};
};
describe "no halt-on-error" => sub {
it "should exit with success code when several perls ran" => sub {
Expand Down

0 comments on commit e0b424d

Please sign in to comment.