[Catalyst-commits] r10598 - Catalyst-Runtime/5.80/trunk/t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Fri Jun 19 20:44:15 GMT 2009
Author: t0m
Date: 2009-06-19 20:44:15 +0000 (Fri, 19 Jun 2009)
New Revision: 10598
Modified:
Catalyst-Runtime/5.80/trunk/t/deprecated.t
Log:
1 more MockObject removal
Modified: Catalyst-Runtime/5.80/trunk/t/deprecated.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/deprecated.t 2009-06-19 20:41:46 UTC (rev 10597)
+++ Catalyst-Runtime/5.80/trunk/t/deprecated.t 2009-06-19 20:44:15 UTC (rev 10598)
@@ -5,7 +5,6 @@
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 @@
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);
}
More information about the Catalyst-commits
mailing list