[libbread-board-perl] 19/66: Add failing test for cloning containers with parameterised subcontainers

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 5a67ce9efbcb84f33cc62a68f8d81a0966961ce1
Author: Florian Ragwitz <rafl at debian.org>
Date:   Sun Jul 21 12:52:31 2013 -0700

    Add failing test for cloning containers with parameterised subcontainers
---
 t/053_parameterized_clone.t |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/t/053_parameterized_clone.t b/t/053_parameterized_clone.t
new file mode 100644
index 0000000..68f333b
--- /dev/null
+++ b/t/053_parameterized_clone.t
@@ -0,0 +1,36 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+use Bread::Board;
+
+my $c = container Foo => as {
+    container Bar => ['Baz'] => as {
+        service moo => (
+            block => sub {
+                my ($s) = @_;
+                $s->param('kooh');
+            },
+            dependencies => {
+                kooh => depends_on('Baz/boo'),
+            },
+        );
+    };
+
+    container Bif => as {
+        service boo => 42;
+    };
+};
+
+is $c->fetch('Bar')->create(Baz => $c->fetch('Bif'))->resolve(service => 'moo'), 42;
+
+my $clone;
+is exception { $clone = $c->clone }, undef;
+
+is $clone->fetch('Bar')->create(Baz => $clone->fetch('Bif'))->resolve(service => 'moo'), 42;
+
+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