Fix my retardedness with ::MVC:: warning having no conditional. Pull all the stuff...
[catagits/Catalyst-Runtime.git] / t / unit_core_plugin.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 22;
7
8 use lib 't/lib';
9
10 {
11
12     package Faux::Plugin;
13
14     sub new { bless {}, shift }
15     my $count = 1;
16     sub count { $count++ }
17 }
18
19 use Catalyst::Test qw/PluginTestApp/;
20
21 ok( get("/compile_time_plugins"), "get ok" );
22 # FIXME - Run time plugin support is insane, and should be removed
23 #         for Catalyst 5.9
24 ok( get("/run_time_plugins"),     "get ok" );
25
26 use_ok 'TestApp';
27 my @expected = qw(
28   Catalyst::Plugin::Test::Errors
29   Catalyst::Plugin::Test::Headers
30   Catalyst::Plugin::Test::Inline
31   Catalyst::Plugin::Test::Plugin
32   TestApp::Plugin::AddDispatchTypes
33   TestApp::Plugin::FullyQualified
34 );
35
36 # Faux::Plugin is no longer reported
37 is_deeply [ TestApp->registered_plugins ], \@expected,
38   'registered_plugins() should only report the plugins for the current class';