force-load Moo::HandleMoose::_TypeMap
[scpubgit/Object-Remote.git] / t / sender.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;
8 use Object::Remote::ModuleSender;
9
10 $ENV{PERL5LIB} = join(
11   ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib)
12 );
13
14 my $ms = Object::Remote::ModuleSender->new(
15   dir_list => [ 't/lib' ]
16 );
17
18 my $connection = Object::Remote::Connector::Local->new(
19                    module_sender => $ms,
20                  )->connect;
21
22 my $counter = Object::Remote->new(
23   connection => $connection,
24   class => 'ORTestClass'
25 );
26
27 isnt($$, $counter->pid, 'Different pid on the other side');
28
29 is($counter->counter, 0, 'Counter at 0');
30
31 is($counter->increment, 1, 'Increment to 1');
32
33 is($counter->counter, 1, 'Counter at 1');
34
35 done_testing;