-use Test::More tests => 10;
+use Test::More tests => 11;
use strict;
use warnings;
use base qw/Catalyst/;
__PACKAGE__->components({ map { ($_, $_) } @complist });
+
+ # this is so $c->log->warn will work
+ __PACKAGE__->setup_log;
}
is(MyApp->comp('MyApp::V::View'), 'MyApp::V::View', 'Explicit return ok');
is(MyApp->comp('Model'), 'MyApp::M::Model', 'Single part return ok');
# regexp fallback
-is(MyApp->comp('::M::'), 'MyApp::M::Model', 'Regex return ok');
+{
+ my $warnings = 0;
+ no warnings 'redefine';
+ local *Catalyst::Log::warn = sub { $warnings++ };
+
+ is(MyApp->comp('::M::'), 'MyApp::M::Model', 'Regex return ok');
+ ok( $warnings, 'regexp fallback for comp() warns' );
+}
is_deeply([ MyApp->comp() ], \@complist, 'Empty return ok');