From ccb6cf33d33e58eef1937253be5c470f9449354a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 21 Feb 2011 13:29:19 -0600 Subject: make constructor injections just use the tc also provide the 'service' key to override creating a service --- t/01-basic.t | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 't/01-basic.t') 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'); -- cgit v1.2.3-54-g00ecf