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 ++++++++++---- t/02-deps.t | 1 - t/03-lifecycle.t | 1 - t/33-constructor-name.t | 1 - 4 files changed, 10 insertions(+), 7 deletions(-) (limited to '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'); 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', ); } -- cgit v1.2.3