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