# 2 initial tests, and 6 per component in the loop below
# (do not forget to update the number of components in test 3 as well)
# 5 extra tests for the loading options
-use Test::More tests => 2 + 6 * 24 + 5;
+# One test for components in inner packages
+use Test::More tests => 2 + 6 * 24 + 5 + 1;
use strict;
use warnings;
use File::Spec;
use File::Path;
-use Test::MockObject;
-
my $libdir = 'test_trash';
unshift(@INC, $libdir);
}
my $shut_up_deprecated_warnings = q{
- use Test::MockObject;
- my $old_logger = __PACKAGE__->log;
- my $logger = Test::MockObject->new;
- $logger->mock('warn', sub {
- my $self = shift;
- return if $_[0] =~ /deprecated/;
- $old_logger->warn(@_);
- });
- __PACKAGE__->log($logger);
+ __PACKAGE__->log(Catalyst::Log->new('fatal'));
};
eval "package $appclass; use Catalyst; $shut_up_deprecated_warnings __PACKAGE__->setup";
is($@, '', "Didn't load component twice");
+$appclass = "InnerComponent";
+
+{
+ package InnerComponent::Controller::Test;
+ use base 'Catalyst::Controller';
+}
+
+$INC{'InnerComponent/Controller/Test.pm'} = 1;
+
+eval "package $appclass; use Catalyst; __PACKAGE__->setup";
+
+isa_ok($appclass->controller('Test'), 'Catalyst::Controller');
+
rmtree($libdir);