X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_component_loading.t;h=1944ab6e63b266e9009948e4d17aeeff10d3c598;hb=ac424253c84a4353b75f35fb409ab11c607a5ed4;hp=55ecda066bafe7067fb021461222368f5a2f33eb;hpb=a61a96b31668324ee13f4e50456f192ee1f61bf4;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_component_loading.t b/t/unit_core_component_loading.t index 55ecda0..1944ab6 100644 --- a/t/unit_core_component_loading.t +++ b/t/unit_core_component_loading.t @@ -2,7 +2,7 @@ # (do not forget to update the number of components in test 3 as well) # 5 extra tests for the loading options # One test for components in inner packages -use Test::More tests => 2 + 6 * 24 + 7 + 1; +use Test::More tests => 2 + 6 * 24 + 8 + 1; use strict; use warnings; @@ -193,8 +193,10 @@ write_component_file([$libdir, $appclass, 'Model', 'TopLevel'], 'Nested', <next::method(\@_); } +sub COMPONENT { \$called++;return shift->next::method(\@_); } +sub called { return \$called }; 1; EOF @@ -202,6 +204,7 @@ EOF eval "package $appclass; use Catalyst; __PACKAGE__->setup"; is($@, '', "Didn't load component twice"); +is($appclass->model('TopLevel::Nested')->called,1, 'COMPONENT called once'); ok($appclass->model('TopLevel::Generated'), 'Have generated model'); is(ref($appclass->model('TopLevel::Generated')), 'FooBarBazQuux',