diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-21 13:29:19 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-21 13:29:19 -0600 |
commit | ccb6cf33d33e58eef1937253be5c470f9449354a (patch) | |
tree | 0b1801b3e187af3f695abbdd71e41fa0946f98be /t | |
parent | 5067979bd1601d557362d79aa03a51665a761a39 (diff) | |
download | bread-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')
-rw-r--r-- | t/01-basic.t | 14 | ||||
-rw-r--r-- | t/02-deps.t | 1 | ||||
-rw-r--r-- | t/03-lifecycle.t | 1 | ||||
-rw-r--r-- | t/33-constructor-name.t | 1 |
4 files changed, 10 insertions, 7 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'); diff --git a/t/02-deps.t b/t/02-deps.t index 4b1143a..578db20 100644 --- a/t/02-deps.t +++ b/t/02-deps.t @@ -30,7 +30,6 @@ my $i; has baz => ( is => 'ro', isa => 'Baz', - class => 'Baz', dependencies => ['bar'], ); } diff --git a/t/03-lifecycle.t b/t/03-lifecycle.t index 8308e59..8b39175 100644 --- a/t/03-lifecycle.t +++ b/t/03-lifecycle.t @@ -30,7 +30,6 @@ my $i; has baz => ( is => 'ro', isa => 'Baz', - class => 'Baz', dependencies => ['bar'], lifecycle => 'Singleton', ); diff --git a/t/33-constructor-name.t b/t/33-constructor-name.t index ef46338..abe367d 100644 --- a/t/33-constructor-name.t +++ b/t/33-constructor-name.t @@ -18,7 +18,6 @@ use Test::Moose; has bar => ( is => 'ro', isa => 'Bar', - class => 'Bar', constructor_name => 'create', ); } |