From: Matt S Trout Date: Mon, 14 May 2012 09:23:43 +0000 (+0000) Subject: it runs! X-Git-Tag: v0.001001~63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b63a955fda065430b5e0e2c37b07ba292ecc7e28;p=scpubgit%2FObject-Remote.git it runs! --- diff --git a/t/basic.t b/t/basic.t new file mode 100644 index 0000000..77f0c69 --- /dev/null +++ b/t/basic.t @@ -0,0 +1,28 @@ +use strictures 1; +use Test::More; + +use Object::Remote::Connector::Local; +use Object::Remote; + +$ENV{PERL5LIB} = join( + ':', ($ENV{PERL5LIB} ? $ENV{PERL5LIB} : ()), qw(lib t/lib) +); + +my $connection = Object::Remote::Connector::Local->new->connect; + +#$Object::Remote::Connection::DEBUG = 1; + +my $proxy = Object::Remote->new( + connection => $connection, + class => 'ORTestClass' +)->proxy; + +isnt($$, $proxy->pid, 'Different pid on the other side'); + +is($proxy->counter, 0, 'Counter at 0'); + +is($proxy->increment, 1, 'Increment to 1'); + +is($proxy->counter, 1, 'Counter at 1'); + +done_testing; diff --git a/t/lib/ORTestClass.pm b/t/lib/ORTestClass.pm new file mode 100644 index 0000000..7e64bf1 --- /dev/null +++ b/t/lib/ORTestClass.pm @@ -0,0 +1,11 @@ +package ORTestClass; + +use Moo; + +has counter => (is => 'rwp', default => sub { 0 }); + +sub increment { $_[0]->_set_counter($_[0]->counter + 1); } + +sub pid { $$ } + +1;