summaryrefslogtreecommitdiffstats
path: root/t/01-basic.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-02-21 13:29:19 -0600
committerJesse Luehrs <doy@tozt.net>2011-02-21 13:29:19 -0600
commitccb6cf33d33e58eef1937253be5c470f9449354a (patch)
tree0b1801b3e187af3f695abbdd71e41fa0946f98be /t/01-basic.t
parent5067979bd1601d557362d79aa03a51665a761a39 (diff)
downloadbread-board-declare-ccb6cf33d33e58eef1937253be5c470f9449354a.tar.gz
bread-board-declare-ccb6cf33d33e58eef1937253be5c470f9449354a.zip
make constructor injections just use the tc
also provide the 'service' key to override creating a service
Diffstat (limited to 't/01-basic.t')
-rw-r--r--t/01-basic.t14
1 files changed, 10 insertions, 4 deletions
diff --git a/t/01-basic.t b/t/01-basic.t
index 38590df..5aff0eb 100644
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -28,9 +28,14 @@ my $i;
);
has baz => (
- is => 'ro',
- isa => 'Baz',
- class => 'Baz',
+ is => 'ro',
+ isa => 'Baz',
+ );
+
+ has baz2 => (
+ is => 'ro',
+ isa => 'Baz',
+ service => 0,
);
has quux => (
@@ -47,7 +52,8 @@ $i = 0;
isa_ok($foo, 'Bread::Board::Container');
ok($foo->has_service($_), "has service $_")
for qw(bar baz quux);
- ok(!$foo->has_service('foo'), "doesn't have service foo");
+ ok(!$foo->has_service($_), "doesn't have service $_")
+ for qw(foo baz2);
isa_ok($foo->get_service('bar'), 'MooseX::Bread::Board::Literal');
isa_ok($foo->get_service('baz'), 'MooseX::Bread::Board::ConstructorInjection');
isa_ok($foo->get_service('quux'), 'MooseX::Bread::Board::BlockInjection');