xt for bridged remote objects
Robert 'phaylon' Sedlacek [Wed, 30 May 2012 18:15:59 +0000 (18:15 +0000)]
xt/bridged-remote.t [new file with mode: 0644]
xt/lib/TestBridge.pm [new file with mode: 0644]
xt/lib/TestClass.pm [new file with mode: 0644]

diff --git a/xt/bridged-remote.t b/xt/bridged-remote.t
new file mode 100644 (file)
index 0000000..abfbcd5
--- /dev/null
@@ -0,0 +1,16 @@
+use strictures 1;
+use Test::More;
+use Test::Fatal;
+use FindBin;
+
+use lib "$FindBin::Bin/lib";
+
+use TestClass;
+use Object::Remote;
+
+is exception {
+  my $bridge = TestBridge->new::on('localhost');
+  is $bridge->result, 23;
+}, undef, 'no error during bridge access';
+
+done_testing;
diff --git a/xt/lib/TestBridge.pm b/xt/lib/TestBridge.pm
new file mode 100644 (file)
index 0000000..7a8b82a
--- /dev/null
@@ -0,0 +1,13 @@
+package TestBridge;
+use Moo;
+
+use TestClass;
+use Object::Remote;
+
+has object => (is => 'lazy');
+
+sub _build_object { TestClass->new::on('root@') }
+
+sub result { (shift)->object->result }
+
+1;
diff --git a/xt/lib/TestClass.pm b/xt/lib/TestClass.pm
new file mode 100644 (file)
index 0000000..7efaf1d
--- /dev/null
@@ -0,0 +1,6 @@
+package TestClass;
+use Moo;
+
+sub result { 23 }
+
+1;