X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbasic.t;h=1547c962cc1efa0305b690564bfb41aedc841140;hb=6ed5d5804fa1e932a18619c971e4704a34b85dc8;hp=07d77efdf55d76cf60ae5f3901fb0fc242095de0;hpb=676438a11cbf6bd49102369824c9d87f70964fd3;p=scpubgit%2FObject-Remote.git diff --git a/t/basic.t b/t/basic.t index 07d77ef..1547c96 100644 --- a/t/basic.t +++ b/t/basic.t @@ -1,21 +1,18 @@ use strictures 1; use Test::More; +use Sys::Hostname qw(hostname); -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; +my $connection = Object::Remote->connect('-'); #$Object::Remote::Connection::DEBUG = 1; -my $remote = Object::Remote->new( - connection => $connection, - class => 'ORTestClass' -); +my $remote = ORTestClass->new::on($connection); isnt($$, $remote->pid, 'Different pid on the other side'); @@ -25,4 +22,16 @@ is($remote->increment, 1, 'Increment to 1'); is($remote->counter, 1, 'Counter at 1'); +my $x = 0; + +is($remote->call_callback(27, sub { $x++ }), 27, "Callback ok"); + +is($x, 1, "Callback called callback"); + +is( + Sys::Hostname->can::on($connection, 'hostname')->(), + hostname(), + 'Remote sub call ok' +); + done_testing;