X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_plugin.t;h=cfa3370a436b20471ada56b4fade237ff9d88db9;hb=30305469e1d8f922119d64d631ccd800358a7698;hp=58ebe1e215f82389770f0b382b65c847318ccc27;hpb=79d000eb280b79249addd9c489504a8d4244dd0f;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_plugin.t b/t/unit_core_plugin.t index 58ebe1e..cfa3370 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,11 +17,29 @@ 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