Release commit for 0.003002
[scpubgit/Object-Remote.git] / t / perl_execute.t
CommitLineData
f129bfaf 1use strictures 1;
2use Test::More;
3
abef6e5b 4$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
f129bfaf 5
55c0d020 6use Object::Remote::Connector::Local;
7use Object::Remote::Connector::SSH;
f129bfaf 8
9my $defaults = Object::Remote::Connector::Local->new;
f129bfaf 10my $normal = $defaults->final_perl_command;
5ccce2d5 11my $ssh = Object::Remote::Connector::SSH->new(ssh_to => 'testhost')->final_perl_command;
aaa31f6e 12my $with_env = do {
13 local $ENV{OBJECT_REMOTE_PERL_BIN} = 'perl_bin_test_value';
14 Object::Remote::Connector::Local->new->final_perl_command;
15};
f129bfaf 16
466ee2c4 17is($defaults->timeout, 10, 'Default connection timeout value is correct');
f129bfaf 18is($defaults->watchdog_timeout, undef, 'Watchdog is not enabled by default');
f129bfaf 19is($defaults->stderr, undef, 'Child process STDERR is clone of parent process STDERR by default');
20
5ccce2d5 21is_deeply($normal, ['perl', '-'], 'Default Perl interpreter arguments correct');
22is_deeply($ssh, [qw(ssh -A testhost), "perl -"], "Arguments using ssh are correct");
aaa31f6e 23is_deeply($with_env, ['perl_bin_test_value', '-'], "Respects OBJECT_REMOTE_PERL_BIN env value");
f129bfaf 24
55c0d020 25done_testing;
f129bfaf 26