[libbread-board-perl] 02/66: add test for dependencies overriding parameters
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 21:23:30 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 e0e74ef0ac7feeebeb1a215312ea9d16373facb9
Author: Jesse Luehrs <doy at tozt.net>
Date: Mon Jun 11 01:35:58 2012 -0500
add test for dependencies overriding parameters
---
t/047_dependencies_override_parameters.t | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/t/047_dependencies_override_parameters.t b/t/047_dependencies_override_parameters.t
new file mode 100644
index 0000000..668429b
--- /dev/null
+++ b/t/047_dependencies_override_parameters.t
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Bread::Board;
+
+my $c = container Foo => as {
+ service a => 'A';
+ service foo => (
+ block => sub { $_[0]->param('a'); },
+ dependencies => ['a'],
+ parameters => {
+ # XXX should optional need to be specified here? or should an
+ # existing dependency of the same name imply that? seems to
+ # parallel the default/required situation in moose, where default
+ # overrides required, but not sure
+ a => { optional => 1 },
+ },
+ );
+};
+
+is($c->resolve(service => 'foo'), 'A');
+is($c->resolve(service => 'foo', parameters => { a => 'B' }), 'B');
+
+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