1 use Test::More tests => 7;
7 my @complist = map { "MyApp::$_"; } qw/C::Controller M::Model V::View/;
12 use base qw/Catalyst/;
14 __PACKAGE__->components({ map { ($_, $_) } @complist });
17 is(MyApp->comp('MyApp::V::View'), 'MyApp::V::View', 'Explicit return ok');
19 is(MyApp->comp('C::Controller'), 'MyApp::C::Controller', 'Two-part return ok');
21 is(MyApp->comp('Model'), 'MyApp::M::Model', 'Single part return ok');
23 is(MyApp->comp('::M::'), 'MyApp::M::Model', 'Regex return ok');
25 is_deeply([ MyApp->comp() ], \@complist, 'Empty return ok');
27 is_deeply([ MyApp->comp('Foo') ], \@complist, 'Fallthrough return ok');
28 # Is this desired behaviour?