X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_component_loading.t;h=55ecda066bafe7067fb021461222368f5a2f33eb;hb=e7e4c4697a2a0f13fd8d250cb0b6b080013747b5;hp=42f1eac39c9de3e58ed3d413d60223b2e849e3c3;hpb=e1dd56e6f190fe600d63c3d3763efb171f67b274;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_component_loading.t b/t/unit_core_component_loading.t index 42f1eac..55ecda0 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 + 5 + 1; +use Test::More tests => 2 + 6 * 24 + 7 + 1; use strict; use warnings; @@ -175,6 +175,9 @@ sub COMPONENT { my \$self = shift->next::method(\@_); no strict 'refs'; *{\__PACKAGE__ . "::whoami"} = sub { return \__PACKAGE__; }; + *${appclass}::Model::TopLevel::GENERATED::ACCEPT_CONTEXT = sub { + return bless {}, 'FooBarBazQuux'; + }; \$self; } @@ -200,6 +203,10 @@ eval "package $appclass; use Catalyst; __PACKAGE__->setup"; is($@, '', "Didn't load component twice"); +ok($appclass->model('TopLevel::Generated'), 'Have generated model'); +is(ref($appclass->model('TopLevel::Generated')), 'FooBarBazQuux', + 'ACCEPT_CONTEXT in generated inner package fired as expected'); + $appclass = "InnerComponent"; {