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