use Test::More;
use strict;
use warnings;
+
use Moose::Meta::Class;
use_ok('Catalyst');
no warnings 'redefine';
*Catalyst::Log::warn = sub { $::warnings++ };
- *Catalyst::Utils::ensure_class_loaded = sub { $::loaded++ if Class::MOP::is_class_loaded(shift) };
+ *Catalyst::Utils::ensure_class_loaded = sub {
+ my $class = shift;
+ $::loaded++
+ if Class::MOP::is_class_loaded($class) && $class =~ /^MyMVCTestApp/
+ };
__PACKAGE__->setup;
}
is ( bless ({stash=>{current_model_instance=> $model, current_model=>'MyMVCTestApp::M::Model' }}, 'MyMVCTestApp')->model , $model,
'current_model_instance precedes current_model ok');
+{
+ use FindBin '$Bin';
+ use lib "$Bin/../lib";
+
+ use Catalyst::Test 'TestAppController';
+
+ is( get('/foo/test_controller'), 'bar', 'controller() with empty args returns current controller' );
+}
+
MyMVCTestApp->config->{default_view} = 'V';
is ( bless ({stash=>{}}, 'MyMVCTestApp')->view , 'MyMVCTestApp::View::V', 'default_view ok');
is ( MyMVCTestApp->view , 'MyMVCTestApp::View::V', 'default_view in class method ok');