[libbread-board-perl] 48/66: Make the container sugar add subcontainers even without a block

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 21:23:38 UTC 2013


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

js pushed a commit to branch master
in repository libbread-board-perl.

commit 78d273d6fade980f6bbda99fc36904b39e67e40c
Author: Florian Ragwitz <rafl at debian.org>
Date:   Wed Aug 28 13:18:27 2013 -0400

    Make the container sugar add subcontainers even without a block
---
 lib/Bread/Board.pm |    2 +-
 t/301_sugar.t      |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/Bread/Board.pm b/lib/Bread/Board.pm
index 673dd9c..24a3f1d 100644
--- a/lib/Bread/Board.pm
+++ b/lib/Bread/Board.pm
@@ -65,7 +65,7 @@ sub container ($;$$) {
             # otherwise it is just
             # someone using &container
             # as a constructor
-            return Bread::Board::Container->new(
+            $c = Bread::Board::Container->new(
                 name => $name
             );
         }
diff --git a/t/301_sugar.t b/t/301_sugar.t
index ae4366b..7ff822f 100644
--- a/t/301_sugar.t
+++ b/t/301_sugar.t
@@ -81,4 +81,12 @@ like( $exception, qr/isn't a service/, "exception contains: isn't a service" );
     }))->resolve(service => 'moo'), 42, 'container $parameterized_container => as {} modifies underlying container';
 }
 
+{
+    my $c = container Foo => as {
+        container 'Bar';
+    };
+
+    isa_ok $c->fetch('Bar'), 'Bread::Board::Container';
+}
+
 done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbread-board-perl.git



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