Handle $c->error called as a class method.
[catagits/Catalyst-Runtime.git] / t / unit_core_plugin.t
index 46647fb..e46797a 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 20;
+use Test::More tests => 22;
 
 use lib 't/lib';
 
@@ -91,3 +91,15 @@ use Catalyst::Test qw/PluginTestApp/;
 
 ok( get("/compile_time_plugins"), "get ok" );
 ok( get("/run_time_plugins"),     "get ok" );
+
+use_ok 'TestApp';
+my @expected = qw(
+  Catalyst::Plugin::Test::Errors
+  Catalyst::Plugin::Test::Headers
+  Catalyst::Plugin::Test::Plugin
+  TestApp::Plugin::FullyQualified
+);
+
+# Faux::Plugin is no longer reported
+is_deeply [ TestApp->registered_plugins ], \@expected,
+  'registered_plugins() should only report the plugins for the current class';