File: sender.t

package info (click to toggle)
libobject-remote-perl 0.003004-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 408 kB
  • ctags: 221
  • sloc: perl: 2,365; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use strictures 1;
use Test::More;

$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;

use Object::Remote::Connector::Local;
use Object::Remote;
use Object::Remote::ModuleSender;

$ENV{PERL5LIB} = join(
  ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib)
);

my $ms = Object::Remote::ModuleSender->new(
  dir_list => [ 't/lib' ]
);

my $connection = Object::Remote::Connector::Local->new(
                   module_sender => $ms,
                 )->connect;

my $counter = Object::Remote->new(
  connection => $connection,
  class => 'ORTestClass'
);

isnt($$, $counter->pid, 'Different pid on the other side');

is($counter->counter, 0, 'Counter at 0');

is($counter->increment, 1, 'Increment to 1');

is($counter->counter, 1, 'Counter at 1');

done_testing;