From: Robert 'phaylon' Sedlacek Date: Wed, 30 May 2012 19:21:42 +0000 (+0000) Subject: test for bridge to local X-Git-Tag: v0.001001~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=commitdiff_plain;h=852c2b28f09c3ef7e3a6e057d033acd65b52c90b;hp=4829a0e16b68906a74ea62265f76c9a68f74893c test for bridge to local --- diff --git a/t/bridged.t b/t/bridged.t new file mode 100644 index 0000000..2c4c24b --- /dev/null +++ b/t/bridged.t @@ -0,0 +1,17 @@ +use strictures 1; +use Test::More; +use Test::Fatal; +use FindBin; + +use lib "$FindBin::Bin/lib"; + +use Object::Remote; + +is exception { + my $bridge = ORTestBridge->new::on('localhost'); + is $bridge->call('counter'), 0; + $bridge->call('increment'); + is $bridge->call('counter'), 1; +}, undef, 'no error during bridge access'; + +done_testing; diff --git a/t/lib/ORTestBridge.pm b/t/lib/ORTestBridge.pm new file mode 100644 index 0000000..26556c9 --- /dev/null +++ b/t/lib/ORTestBridge.pm @@ -0,0 +1,15 @@ +package ORTestBridge; +use Moo; + +use Object::Remote; + +has object => (is => 'lazy'); + +sub _build_object { ORTestClass->new::on('-') } + +sub call { + my ($self, $method, @args) = @_; + return $self->object->$method(@args); +} + +1;