callback calling
[scpubgit/Object-Remote.git] / t / basic.t
index 77f0c69..24913dc 100644 (file)
--- a/t/basic.t
+++ b/t/basic.t
@@ -12,17 +12,23 @@ my $connection = Object::Remote::Connector::Local->new->connect;
 
 #$Object::Remote::Connection::DEBUG = 1;
 
-my $proxy = Object::Remote->new(
+my $remote = Object::Remote->new(
   connection => $connection,
   class => 'ORTestClass'
-)->proxy;
+);
+
+isnt($$, $remote->pid, 'Different pid on the other side');
+
+is($remote->counter, 0, 'Counter at 0');
+
+is($remote->increment, 1, 'Increment to 1');
 
-isnt($$, $proxy->pid, 'Different pid on the other side');
+is($remote->counter, 1, 'Counter at 1');
 
-is($proxy->counter, 0, 'Counter at 0');
+my $x = 0;
 
-is($proxy->increment, 1, 'Increment to 1');
+is($remote->call_callback(27, sub { $x++ }), 27, "Callback ok");
 
-is($proxy->counter, 1, 'Counter at 1');
+is($x, 1, "Callback called callback");
 
 done_testing;