[libbread-board-perl] 21/66: Add a basic failing test for parameterised subcontainers depending on services in their enclosing container
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 21:23:33 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 af635cf91695f0205a6ed2cf6bd892f6f76e9bab
Author: Florian Ragwitz <rafl at debian.org>
Date: Sun Jul 21 13:04:36 2013 -0700
Add a basic failing test for parameterised subcontainers depending on services in their enclosing container
---
t/054_parameterized_backref.t | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/t/054_parameterized_backref.t b/t/054_parameterized_backref.t
new file mode 100644
index 0000000..90bd6db
--- /dev/null
+++ b/t/054_parameterized_backref.t
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+use Bread::Board;
+
+my $c = container Foo => as {
+ service fez => 123;
+
+ container Bar => ['Baz'] => as {
+ service moo => (
+ block => sub {
+ my ($s) = @_;
+ $s->param('kooh') + $s->param('fez');
+ },
+ dependencies => {
+ kooh => depends_on('Baz/boo'),
+ fez => depends_on('../fez'),
+ },
+ );
+ };
+
+ container Bif => as {
+ service boo => 42;
+ };
+};
+
+is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 165;
+
+my $clone;
+is exception { $clone = $c->clone }, undef;
+
+is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 165;
+
+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