X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_plugin.t;h=03d16f62f932c6bf000aaa1de3a4b1168532dea5;hb=1be0c4f8966328b3d90c5ebf82f924d97a15dfd9;hp=36c170ddd47d1216b7dc750e8a62eae984db8421;hpb=052a2d89ac696b137f1456a339a77c1607dfe544;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_plugin.t b/t/unit_core_plugin.t index 36c170d..03d16f6 100644 --- a/t/unit_core_plugin.t +++ b/t/unit_core_plugin.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 22; +use Test::More tests => 24; use lib 't/lib'; @@ -16,19 +16,49 @@ use lib 't/lib'; sub count { $count++ } } +my $warnings = 0; + +use PluginTestApp; +my $logger = Class::MOP::Class->create_anon_class( + methods => { + error => sub {0}, + debug => sub {0}, + info => sub {0}, + warn => sub { + if ($_[1] =~ /plugin method is deprecated/) { + $warnings++; + return; + } + die "Caught unexpected warning: " . $_[1]; + }, + }, +)->new_object; +PluginTestApp->log($logger); + 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 Catalyst::Plugin::Test::Headers + Catalyst::Plugin::Test::Inline + Catalyst::Plugin::Test::MangleDollarUnderScore Catalyst::Plugin::Test::Plugin + TestApp::Plugin::AddDispatchTypes 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'; +