[Catalyst-commits] r7001 - in trunk/Catalyst-View-Mason/t: .
lib/TestApp
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Mon Oct 15 15:38:27 GMT 2007
Author: rafl
Date: 2007-10-15 15:38:27 +0100 (Mon, 15 Oct 2007)
New Revision: 7001
Added:
trunk/Catalyst-View-Mason/t/lib/TestApp/FakeCtx.pm
Modified:
trunk/Catalyst-View-Mason/t/comp_root_ref.t
Log:
Silence some warnings in t/comp_root_ref.t by not using Test::Mock*.
Modified: trunk/Catalyst-View-Mason/t/comp_root_ref.t
===================================================================
--- trunk/Catalyst-View-Mason/t/comp_root_ref.t 2007-10-15 14:38:18 UTC (rev 7000)
+++ trunk/Catalyst-View-Mason/t/comp_root_ref.t 2007-10-15 14:38:27 UTC (rev 7001)
@@ -5,12 +5,6 @@
use Scalar::Util qw/blessed/;
use Test::More;
-eval 'use Test::MockObject::Extends';
-plan skip_all => 'Test::MockObject::Extends required' if $@;
-
-eval 'use Test::MockModule';
-plan skip_all => 'Test::MockObject required' if $@;
-
eval 'use Test::Exception';
plan skip_all => 'Test::Exception required' if $@;
@@ -19,6 +13,7 @@
use FindBin;
use lib "$FindBin::Bin/lib";
+use TestApp::FakeCtx;
use TestApp::View::Mason::CompRootRef;
my @comp_roots = (
@@ -28,21 +23,8 @@
\*STDIN,
);
-my $c = Test::MockObject::Extends->new('Catalyst');
+my $c = TestApp::FakeCtx->new;
-$c->mock('config' => sub {
- return {};
-});
-
-{
- my $log = Test::MockObject->new(\do { my $o });
- $log->set_true(qw/debug info warn error fatal is_debug/);
-
- $c->mock('log' => sub {
- return $log;
- });
-}
-
for my $comp_root (@comp_roots) {
my $str = $comp_root . q//;
Added: trunk/Catalyst-View-Mason/t/lib/TestApp/FakeCtx.pm
===================================================================
--- trunk/Catalyst-View-Mason/t/lib/TestApp/FakeCtx.pm (rev 0)
+++ trunk/Catalyst-View-Mason/t/lib/TestApp/FakeCtx.pm 2007-10-15 14:38:27 UTC (rev 7001)
@@ -0,0 +1,22 @@
+package TestApp::FakeCtx;
+
+use strict;
+use warnings;
+use TestApp::FakeLog;
+use base qw/Catalyst/;
+
+sub new {
+ my ($class) = @_;
+
+ my $self = bless {}, $class;
+
+ $self->log( TestApp::FakeLog->new([]) );
+
+ return $self;
+}
+
+sub config {
+ return {};
+}
+
+1;
More information about the Catalyst-commits
mailing list