From: Tomas Doran Date: Fri, 19 Jun 2009 20:44:15 +0000 (+0000) Subject: 1 more MockObject removal X-Git-Tag: 5.80014_02~145 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=6a163489e06d0e5035aa3f1a155e8c9d82b3ffd2 1 more MockObject removal --- diff --git a/t/deprecated.t b/t/deprecated.t index a7e2997..cfb5adf 100644 --- a/t/deprecated.t +++ b/t/deprecated.t @@ -5,7 +5,6 @@ use warnings; use FindBin qw/$Bin/; use lib "$Bin/lib"; use Test::More tests => 4; -use Test::MockObject; my $warnings; BEGIN { # Do this at compile time in case we generate a warning when use @@ -15,8 +14,17 @@ BEGIN { # Do this at compile time in case we generate a warning when use use Catalyst; # Cause catalyst to be used so I can fiddle with the logging. my $mvc_warnings; BEGIN { - my $logger = Test::MockObject->new; - $logger->mock('warn', sub { $mvc_warnings++ if $_[1] =~ /switch your class names/ }); + my $logger = Class::MOP::Class->create_anon_class( + methods => { + warn => sub { + if ($_[1] =~ /switch your class names/) { + $mvc_warnings++; + return; + } + die "Caught unexpected warning: " . $_[1]; + }, + }, +)->new_object; Catalyst->log($logger); }