Switched to Module::Install
[catagits/Catalyst-Runtime.git] / t / unit_core_mvc.t
CommitLineData
8dc75d26 1use Test::More tests => 10;
af3ff00e 2use strict;
3use warnings;
4
5use_ok('Catalyst');
6
7my @complist =
8 map { "MyApp::$_"; }
8dc75d26 9 qw/C::Controller M::Model V::View Controller::C Model::M View::V Controller::Model::Dummy::Model Model::Dummy::Model/;
af3ff00e 10
8dc75d26 11my $thingie={};
12bless $thingie,'MyApp::Model::Test::Object';
13push @complist,$thingie;
af3ff00e 14{
15
16 package MyApp;
17
18 use base qw/Catalyst/;
19
20 __PACKAGE__->components( { map { ( $_, $_ ) } @complist } );
21}
22
23is( MyApp->view('View'), 'MyApp::V::View', 'V::View ok' );
24
25is( MyApp->controller('Controller'),
26 'MyApp::C::Controller', 'C::Controller ok' );
27
28is( MyApp->model('Model'), 'MyApp::M::Model', 'M::Model ok' );
29
8dc75d26 30is( MyApp->model('Dummy::Model'), 'MyApp::Model::Dummy::Model', 'Model::Dummy::Model ok' );
31
32isa_ok( MyApp->model('Test::Object'), 'MyApp::Model::Test::Object', 'Test::Object ok' );
33
34is( MyApp->controller('Model::Dummy::Model'), 'MyApp::Controller::Model::Dummy::Model', 'Controller::Model::Dummy::Model ok' );
35
af3ff00e 36is( MyApp->view('V'), 'MyApp::View::V', 'View::V ok' );
37
38is( MyApp->controller('C'), 'MyApp::Controller::C', 'Controller::C ok' );
39
40is( MyApp->model('M'), 'MyApp::Model::M', 'Model::M ok' );