no runtime plugins; _test_plugins is method on application now
Zbigniew Łukasiak [Fri, 20 Nov 2009 18:00:35 +0000 (18:00 +0000)]
t/aggregate/unit_core_plugin.t
t/lib/PluginTestApp/Controller/Root.pm

index 11cef84..6532834 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests => 11;
 
 use lib 't/lib';
 
@@ -38,14 +38,9 @@ use Catalyst::Test qw/PluginTestApp/;
 
 ok( get("/compile_time_plugins"), "get ok" );
 is( $warnings, 0, 'no warnings' );
-# FIXME - Run time plugin support is insane, and should be removed
-#         for Catalyst 5.9
-ok( get("/run_time_plugins"),     "get ok" );
 
 local $ENV{CATALYST_DEBUG} = 0;
 
-is( $warnings, 1, '1 warning' );
-
 use_ok 'TestApp';
 my @expected = qw(
   Catalyst::Plugin::Test::Errors
index 19d1f18..b06549a 100644 (file)
@@ -3,11 +3,6 @@ use Test::More;
 
 use base 'Catalyst::Controller';
 
-#use Catalyst qw(
-#        Test::Plugin
-#        +TestApp::Plugin::FullyQualified
-#        );
-
 __PACKAGE__->config->{namespace} = '';
 
 sub compile_time_plugins : Local {
@@ -17,37 +12,7 @@ sub compile_time_plugins : Local {
     isa_ok $c->application, 'TestApp::Plugin::FullyQualified';
 
     can_ok $c, 'registered_plugins';
-    $c->_test_plugins;
-
-    $c->res->body("ok");
-}
-
-sub run_time_plugins : Local {
-    my ( $self, $c ) = @_;
-
-    $c->_test_plugins;
-    my $faux_plugin = 'Faux::Plugin';
-
-# Trick perl into thinking the plugin is already loaded
-    $INC{'Faux/Plugin.pm'} = 1;
-
-    ref($c)->plugin( faux => $faux_plugin );
-
-    isa_ok $c, 'Catalyst::Plugin::Test::Plugin';
-    isa_ok $c, 'TestApp::Plugin::FullyQualified';
-    ok !$c->isa($faux_plugin),
-    '... and it should not inherit from the instant plugin';
-    can_ok $c, 'faux';
-    is $c->faux->count, 1, '... and it should behave correctly';
-    is_deeply [ $c->registered_plugins ],
-    [
-        qw/Catalyst::Plugin::Test::Plugin
-        Faux::Plugin
-        TestApp::Plugin::FullyQualified/
-        ],
-    'registered_plugins() should report all plugins';
-    ok $c->registered_plugins('Faux::Plugin'),
-    '... and even the specific instant plugin';
+    $c->application->_test_plugins;
 
     $c->res->body("ok");
 }