[Catalyst-commits] r10595 - Catalyst-Runtime/5.80/trunk/t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Fri Jun 19 20:39:19 GMT 2009
Author: t0m
Date: 2009-06-19 20:39:19 +0000 (Fri, 19 Jun 2009)
New Revision: 10595
Modified:
Catalyst-Runtime/5.80/trunk/t/unit_core_setup_stats.t
Log:
Remove Test::MockObject
Modified: Catalyst-Runtime/5.80/trunk/t/unit_core_setup_stats.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/unit_core_setup_stats.t 2009-06-19 20:35:41 UTC (rev 10594)
+++ Catalyst-Runtime/5.80/trunk/t/unit_core_setup_stats.t 2009-06-19 20:39:19 UTC (rev 10595)
@@ -2,18 +2,22 @@
use warnings;
use Test::More tests => 5;
-use Test::MockObject;
+use Class::MOP::Class;
use Catalyst ();
my %log_messages; # TODO - Test log messages as expected.
-my $mock_log = Test::MockObject->new;
-foreach my $level (qw/debug info warn error fatal/) {
- $mock_log->mock($level, sub {
- $log_messages{$level} ||= [];
- push(@{ $log_messages{$level} }, $_[1]);
- });
-}
+my $mock_log = Class::MOP::Class->create_anon_class(
+ methods => {
+ map { my $level = $_;
+ $level => sub {
+ $log_messages{$level} ||= [];
+ push(@{ $log_messages{$level} }, $_[1]);
+ },
+ }
+ qw/debug info warn error fatal/,
+ },
+)->new_object;
sub mock_app {
my $name = shift;
More information about the Catalyst-commits
mailing list