add Class::Load to dev prereqs
[scpubgit/Object-Remote.git] / t / sender.t
CommitLineData
542d5b5c 1use strictures 1;
2use Test::More;
3
abef6e5b 4$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;
f129bfaf 5
542d5b5c 6use Object::Remote::Connector::Local;
7use Object::Remote;
8use Object::Remote::ModuleSender;
9
10$ENV{PERL5LIB} = join(
11 ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib)
12);
13
542d5b5c 14my $ms = Object::Remote::ModuleSender->new(
15 dir_list => [ 't/lib' ]
16);
17
03f41c0e 18my $connection = Object::Remote::Connector::Local->new(
19 module_sender => $ms,
20 )->connect;
542d5b5c 21
676438a1 22my $counter = Object::Remote->new(
542d5b5c 23 connection => $connection,
24 class => 'ORTestClass'
676438a1 25);
542d5b5c 26
676438a1 27isnt($$, $counter->pid, 'Different pid on the other side');
542d5b5c 28
676438a1 29is($counter->counter, 0, 'Counter at 0');
542d5b5c 30
676438a1 31is($counter->increment, 1, 'Increment to 1');
542d5b5c 32
676438a1 33is($counter->counter, 1, 'Counter at 1');
542d5b5c 34
35done_testing;