[libmessage-passing-zeromq-perl] 10/78: Fix

Jonas Smedegaard js at alioth.debian.org
Mon Sep 30 09:28:17 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmessage-passing-zeromq-perl.

commit b807ad9004460a6ae0b915cf4ffb825cb3eac0e4
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Mar 4 12:49:25 2012 +0000

    Fix
---
 lib/Log/Stash/ZeroMQ/Role/HasAContext.pm |   21 +++++++++++++++++++++
 t/input.t                                |    2 +-
 t/output.t                               |    2 +-
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/lib/Log/Stash/ZeroMQ/Role/HasAContext.pm b/lib/Log/Stash/ZeroMQ/Role/HasAContext.pm
new file mode 100644
index 0000000..f4cfc86
--- /dev/null
+++ b/lib/Log/Stash/ZeroMQ/Role/HasAContext.pm
@@ -0,0 +1,21 @@
+package Log::Stash::ZeroMQ::Role::HasAContext;
+use Moose::Role;
+use Log::Stash::ZeroMQ ();
+use ZeroMQ ':all';
+use Scalar::Util qw/ weaken /;
+use namespace::autoclean;
+
+has _ctx => (
+    is => 'ro',
+    isa => 'ZeroMQ::Context',
+    lazy => 1,
+    default => sub {
+        my $ctx = ZeroMQ::Context->new();
+        push(@Log::Stash::ZeroMQ::CONTEXTS, $ctx);
+        weaken($Log::Stash::ZeroMQ::CONTEXTS[-1]);
+        $ctx;
+    },
+    clearer => '_clear_ctx',
+);
+
+1;
diff --git a/t/input.t b/t/input.t
index 07f0ac7..f16344e 100644
--- a/t/input.t
+++ b/t/input.t
@@ -24,7 +24,7 @@ $socket->send('{"message":"foo"}');
 
 $cv->recv;
 
-is $output->messages_count, 1;
+is $output->message_count, 1;
 
 is_deeply [$output->messages], [{message => "foo"}];
 
diff --git a/t/output.t b/t/output.t
index a7f6d9a..818b925 100644
--- a/t/output.t
+++ b/t/output.t
@@ -21,7 +21,7 @@ my $input = Log::Stash::Input::ZeroMQ->new(
 );
 $cv->recv;
 
-is $input->output_to->messages_count, 1;
+is $input->output_to->message_count, 1;
 is_deeply([$input->output_to->messages], [{foo => 'bar'}]);
 
 done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmessage-passing-zeromq-perl.git



More information about the Pkg-perl-cvs-commits mailing list