X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_plugin.t;h=cb48159fe20b92bd5be49bbe10dab0feb27896b0;hb=33632a44f189d7d49c8060076e382f2df36d7283;hp=97f8d7b38fca23b9404be491565cdfbda3ef1e61;hpb=ae29b412955743885e80350085167b54b69672da;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_plugin.t b/t/unit_core_plugin.t index 97f8d7b..cb48159 100644 --- a/t/unit_core_plugin.t +++ b/t/unit_core_plugin.t @@ -2,8 +2,9 @@ use strict; use warnings; +use Test::MockObject::Extends; -use Test::More tests => 22; +use Test::More tests => 24; use lib 't/lib'; @@ -16,18 +17,35 @@ use lib 't/lib'; sub count { $count++ } } +my $warnings = 0; + +use PluginTestApp; +my $logger = Test::MockObject::Extends->new(PluginTestApp->log); +$logger->mock('warn', sub { + if ($_[1] =~ /plugin method is deprecated/) { + $warnings++; + return; + } + die "Caught unexpected warning: " . $_[1]; +}); +#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" ); +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