From: Tyler Riddle Date: Thu, 31 Jan 2013 22:14:43 +0000 (-0800) Subject: OBJECT_REMOTE_PERL_BIN environment value was ignored, fixed and put a test on it X-Git-Tag: v0.003001_01~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=commitdiff_plain;h=aaa31f6ef3e6bb283f0175ba4b0efda9e5223486 OBJECT_REMOTE_PERL_BIN environment value was ignored, fixed and put a test on it --- diff --git a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm index c430fa6..41373a8 100644 --- a/lib/Object/Remote/Role/Connector/PerlInterpreter.pm +++ b/lib/Object/Remote/Role/Connector/PerlInterpreter.pm @@ -39,7 +39,7 @@ sub _build_perl_command { if (exists $ENV{OBJECT_REMOTE_PERL_BIN}) { $perl_bin = $ENV{OBJECT_REMOTE_PERL_BIN}; } - return [qw(perl -)]; + return [$perl_bin, '-']; } sub _build_forward_env { diff --git a/t/perl_execute.t b/t/perl_execute.t index e9c52d2..2e95bf4 100644 --- a/t/perl_execute.t +++ b/t/perl_execute.t @@ -9,6 +9,10 @@ use Object::Remote::Connector::SSH; my $defaults = Object::Remote::Connector::Local->new; my $normal = $defaults->final_perl_command; my $ssh = Object::Remote::Connector::SSH->new(ssh_to => 'testhost')->final_perl_command; +my $with_env = do { + local $ENV{OBJECT_REMOTE_PERL_BIN} = 'perl_bin_test_value'; + Object::Remote::Connector::Local->new->final_perl_command; +}; is($defaults->timeout, 10, 'Default connection timeout value is correct'); is($defaults->watchdog_timeout, undef, 'Watchdog is not enabled by default'); @@ -16,6 +20,7 @@ is($defaults->stderr, undef, 'Child process STDERR is clone of parent process ST is_deeply($normal, ['perl', '-'], 'Default Perl interpreter arguments correct'); is_deeply($ssh, [qw(ssh -A testhost), "perl -"], "Arguments using ssh are correct"); +is_deeply($with_env, ['perl_bin_test_value', '-'], "Respects OBJECT_REMOTE_PERL_BIN env value"); done_testing;