Merge branch 'master' into gsoc_breadboard
[catagits/Catalyst-Runtime.git] / t / lib / PluginTestApp.pm
1 package PluginTestApp;
2 use Test::More;
3 use base 'Catalyst';
4
5 use Catalyst (
6     'Test::Plugin',
7     '+TestApp::Plugin::FullyQualified',
8     (eval { require MooseX::Role::Parameterized; 1 }
9         ? ('+TestApp::Plugin::ParameterizedRole' => { method_name => 'affe' })
10         : ()),
11 );
12
13 sub _test_plugins {
14     my $c = shift;
15     is_deeply [ $c->registered_plugins ],
16     [
17         qw/Catalyst::Plugin::Test::Plugin
18         TestApp::Plugin::FullyQualified/
19         ],
20     '... and it should report the correct plugins';
21     ok $c->registered_plugins('Catalyst::Plugin::Test::Plugin'),
22     '... or if we have a particular plugin';
23     ok $c->registered_plugins('Test::Plugin'),
24     '... even if it is not fully qualified';
25     ok !$c->registered_plugins('No::Such::Plugin'),
26     '... and it should return false if the plugin does not exist';
27 }
28
29 __PACKAGE__->setup;