From: André Walker Date: Fri, 19 Aug 2011 05:28:46 +0000 (-0300) Subject: let each test component do one thing. leave depends_on(DefaultSetup) for a while X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=072b618d95788494189bbe1d53549a9c18b187a2 let each test component do one thing. leave depends_on(DefaultSetup) for a while --- diff --git a/t/lib/TestAppCustomContainer/Model/DependsOnDefaultSetup.pm b/t/lib/TestAppCustomContainer/Model/DependsOnDefaultSetup.pm new file mode 100644 index 0000000..1f2bdd2 --- /dev/null +++ b/t/lib/TestAppCustomContainer/Model/DependsOnDefaultSetup.pm @@ -0,0 +1,10 @@ +package TestAppCustomContainer::Model::DependsOnDefaultSetup; +use Moose; +extends 'Catalyst::Model'; +#with 'TestAppCustomContainer::Role::HoldsFoo'; + +__PACKAGE__->meta->make_immutable; + +no Moose; +1; + diff --git a/t/lib/TestAppCustomContainer/Model/RequestLifeCycle.pm b/t/lib/TestAppCustomContainer/Model/RequestLifeCycle.pm index 8f6de9a..e52ee88 100644 --- a/t/lib/TestAppCustomContainer/Model/RequestLifeCycle.pm +++ b/t/lib/TestAppCustomContainer/Model/RequestLifeCycle.pm @@ -1,8 +1,7 @@ package TestAppCustomContainer::Model::RequestLifeCycle; use Moose; extends 'Catalyst::Model'; -with 'TestAppCustomContainer::Role::HoldsFoo', - 'TestAppCustomContainer::Role::ACCEPT_CONTEXT'; +with 'TestAppCustomContainer::Role::ACCEPT_CONTEXT'; __PACKAGE__->meta->make_immutable; diff --git a/t/lib/TestAppCustomContainer/Model/SingletonLifeCycle.pm b/t/lib/TestAppCustomContainer/Model/SingletonLifeCycle.pm index c62afea..d7bd895 100644 --- a/t/lib/TestAppCustomContainer/Model/SingletonLifeCycle.pm +++ b/t/lib/TestAppCustomContainer/Model/SingletonLifeCycle.pm @@ -1,8 +1,7 @@ package TestAppCustomContainer::Model::SingletonLifeCycle; use Moose; extends 'Catalyst::Model'; -with 'TestAppCustomContainer::Role::HoldsFoo', - 'TestAppCustomContainer::Role::FailIfACCEPT_CONTEXTCalled'; +with 'TestAppCustomContainer::Role::FailIfACCEPT_CONTEXTCalled'; __PACKAGE__->meta->make_immutable; diff --git a/t/lib/TestAppCustomContainer/NoSugarContainer.pm b/t/lib/TestAppCustomContainer/NoSugarContainer.pm index 14f5f34..9027592 100644 --- a/t/lib/TestAppCustomContainer/NoSugarContainer.pm +++ b/t/lib/TestAppCustomContainer/NoSugarContainer.pm @@ -17,7 +17,6 @@ sub BUILD { catalyst_component_name => 'TestAppCustomContainer::Model::SingletonLifeCycle', dependencies => { application_name => depends_on( '/application_name' ), - foo => depends_on('/model/DefaultSetup'), }, ) ); @@ -31,13 +30,25 @@ sub BUILD { catalyst_component_name => 'TestAppCustomContainer::Model::RequestLifeCycle', dependencies => { application_name => depends_on( '/application_name' ), - # FIXME - this is what is blowing up everything: - # DefaultSetup needs the context. It's not getting it here! - foo => depends_on('/model/DefaultSetup'), }, ) ); +# warn("Add DependsOnDefaultSetup to model"); +# $self->get_sub_container('model')->add_service( +# Catalyst::IOC::ConstructorInjection->new( +# name => 'DependsOnDefaultSetup', +# class => 'TestAppCustomContainer::Model::DependsOnDefaultSetup', +# catalyst_component_name => 'TestAppCustomContainer::Model::DependsOnDefaultSetup', +# dependencies => { +# application_name => depends_on( '/application_name' ), +# # FIXME - this is what is blowing up everything: +# # DefaultSetup needs the context. It's not getting it here! +# foo => depends_on('/model/DefaultSetup'), +# }, +# ) +# ); + # Broken deps!?! # $self->get_sub_container('model')->add_service( # Catalyst::IOC::BlockInjection->new(