X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_mvc.t;h=fa1683c196b67fbc3e949982e1bcd406759beff5;hb=e10b40fdbf404819d60169dee88175777d1bf109;hp=653b89f288051ad2141cc061228e354ef6dba2cc;hpb=5a53ef3ddf982a23c517e4cea657ae678a73bffe;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_mvc.t b/t/aggregate/unit_core_mvc.t index 653b89f..fa1683c 100644 --- a/t/aggregate/unit_core_mvc.t +++ b/t/aggregate/unit_core_mvc.t @@ -1,6 +1,7 @@ use Test::More; use strict; use warnings; + use Moose::Meta::Class; use_ok('Catalyst'); @@ -36,7 +37,11 @@ Moose::Meta::Class->create( 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; } @@ -115,6 +120,15 @@ is ( bless ({stash=>{current_model_instance=> $model }}, 'MyMVCTestApp')->model 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');