Allow parameterized roles to be applied as plugins.
[catagits/Catalyst-Runtime.git] / t / lib / PluginTestApp / Controller / Root.pm
index e784d96..7bec366 100644 (file)
@@ -31,9 +31,16 @@ sub run_time_plugins : Local {
 # Trick perl into thinking the plugin is already loaded
     $INC{'Faux/Plugin.pm'} = 1;
 
-    __PACKAGE__->plugin( faux => $faux_plugin );
+    ref($c)->plugin( faux => $faux_plugin );
 
     isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
+
+    # applied parameterized role
+    if (eval { require MooseX::Role::Parameterized; 1 }) {
+        can_ok $c, 'affe';
+        is $c->affe, 'birne', 'right method created by parameterized role';
+    }
+
     isa_ok $c, 'TestApp::Plugin::FullyQualified';
     ok !$c->isa($faux_plugin),
     '... and it should not inherit from the instant plugin';