remove t/logsetup.pl and move feature into $ENV{OBJECT_REMOTE_TEST_LOGGER}; set to...
[scpubgit/Object-Remote.git] / t / basic.t
1 use strictures 1;
2 use Test::More;
3 use Sys::Hostname qw(hostname);
4
5 $ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
6
7 use Object::Remote;
8
9 $ENV{PERL5LIB} = join(
10   ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib t/lib)
11 );
12
13 my $connection = Object::Remote->connect('-');
14
15 #$Object::Remote::Connection::DEBUG = 1;
16
17 my $remote = ORTestClass->new::on($connection);
18
19 isnt($$, $remote->pid, 'Different pid on the other side');
20
21 is($remote->counter, 0, 'Counter at 0');
22
23 is($remote->increment, 1, 'Increment to 1');
24
25 is($remote->counter, 1, 'Counter at 1');
26
27 my $x = 0;
28
29 is($remote->call_callback(27, sub { $x++ }), 27, "Callback ok");
30
31 is($x, 1, "Callback called callback");
32
33 is(
34   Sys::Hostname->can::on($connection, 'hostname')->(),
35   hostname(),
36   'Remote sub call ok'
37 );
38
39 done_testing;