X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Funit_core_plugin.t;h=93d08d85de530d57dc20d0ea5a0b961b4d91ef0e;hb=9b1db775e21c29d58957aa1eb7f1446c83b4967a;hp=09bcfa142184daa09f2ad82c52e045eff78a6a70;hpb=2938f7a0daa2ed737ca5cf64a4c60bab1581dda5;p=catagits%2FCatalyst-Runtime.git diff --git a/t/unit_core_plugin.t b/t/unit_core_plugin.t index 09bcfa1..93d08d8 100644 --- a/t/unit_core_plugin.t +++ b/t/unit_core_plugin.t @@ -2,7 +2,6 @@ use strict; use warnings; -use Test::MockObject::Extends; use Test::More tests => 24; @@ -20,15 +19,18 @@ use lib 't/lib'; 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); +my $logger = Class::MOP::Class->create_anon_class( + methods => { + 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/; @@ -42,10 +44,10 @@ is( $warnings, 1, '1 warning' ); use_ok 'TestApp'; my @expected = qw( - Catalyst::Plugin::MangleDollarUnderScore 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