more tests for $c->model and friends.
Marcus Ramberg [Tue, 15 Nov 2005 11:35:21 +0000 (11:35 +0000)]
t/unit/core/mvc.t

index f96002b..4f964eb 100644 (file)
@@ -1,4 +1,4 @@
-use Test::More tests => 7;
+use Test::More tests => 10;
 use strict;
 use warnings;
 
@@ -6,8 +6,11 @@ use_ok('Catalyst');
 
 my @complist =
   map { "MyApp::$_"; }
-  qw/C::Controller M::Model V::View Controller::C Model::M View::V/;
+  qw/C::Controller M::Model V::View Controller::C Model::M View::V Controller::Model::Dummy::Model Model::Dummy::Model/;
 
+my $thingie={};
+bless $thingie,'MyApp::Model::Test::Object';
+push @complist,$thingie;
 {
 
     package MyApp;
@@ -24,6 +27,12 @@ is( MyApp->controller('Controller'),
 
 is( MyApp->model('Model'), 'MyApp::M::Model', 'M::Model ok' );
 
+is( MyApp->model('Dummy::Model'), 'MyApp::Model::Dummy::Model', 'Model::Dummy::Model ok' );
+
+isa_ok( MyApp->model('Test::Object'), 'MyApp::Model::Test::Object', 'Test::Object ok' );
+
+is( MyApp->controller('Model::Dummy::Model'), 'MyApp::Controller::Model::Dummy::Model', 'Controller::Model::Dummy::Model ok' );
+
 is( MyApp->view('V'), 'MyApp::View::V', 'View::V ok' );
 
 is( MyApp->controller('C'), 'MyApp::Controller::C', 'Controller::C ok' );