X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_component_loading.t;h=a408dd78d72526f76768d0da4400da4cac25f42a;hp=2c53144f94dbf44d2a2a7440fbfa8c44689bc943;hb=161710a39409d2afd256463471b8014a1c69adf4;hpb=06400669da6cf01420f8bdc444d799ed8ff07ae2 diff --git a/t/aggregate/unit_core_component_loading.t b/t/aggregate/unit_core_component_loading.t index 2c53144..a408dd7 100644 --- a/t/aggregate/unit_core_component_loading.t +++ b/t/aggregate/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 + 8 + 1; +use Test::More tests => 2 + 6 * 24 + 9 + 1; use strict; use warnings; @@ -152,12 +152,20 @@ foreach my $component (@components) { ); } + make_component_file( + $libdir, + 'ExternalExtra', + 'Controller', + 'Controller', + 'FooExternal', + ); + eval qq( package $appclass; use Catalyst; $shut_up_deprecated_warnings __PACKAGE__->config->{ setup_components } = { - search_extra => [ '::Extra' ], + search_extra => [ '::Extra', 'ExternalExtra::Controller' ], except => [ "${appclass}::Controller::Foo" ] }; __PACKAGE__->setup; @@ -167,11 +175,13 @@ can_ok( $appclass, 'components'); $complist = $appclass->components; -is(scalar keys %$complist, 24+1, "Correct number of components loaded"); +is(scalar keys %$complist, 24+2, "Correct number of components loaded"); ok( !exists $complist->{ "${appclass}::Controller::Foo" }, 'Controller::Foo was skipped' ); ok( exists $complist->{ "${appclass}::Extra::Foo" }, 'Extra::Foo was loaded' ); +isa_ok($appclass->controller('FooExternal'), 'Catalyst::Controller', 'ExternalExtra::Controller::FooExternal was loaded'); + rmtree($libdir); $appclass = "ComponentOnce";