[Catalyst-commits] r6803 - trunk/Catalyst-View-Mason/t
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Tue Aug 28 17:03:47 GMT 2007
Author: rafl
Date: 2007-08-28 17:03:47 +0100 (Tue, 28 Aug 2007)
New Revision: 6803
Added:
trunk/Catalyst-View-Mason/t/deprecation.t
Log:
Test use_match deprecation warning.
Added: trunk/Catalyst-View-Mason/t/deprecation.t
===================================================================
--- trunk/Catalyst-View-Mason/t/deprecation.t (rev 0)
+++ trunk/Catalyst-View-Mason/t/deprecation.t 2007-08-28 16:03:47 UTC (rev 6803)
@@ -0,0 +1,31 @@
+#!perl
+
+use strict;
+use warnings;
+use Test::More;
+
+eval 'use Test::MockObject::Extends';
+plan skip_all => 'Test::MockModule::Extends required' if $@;
+
+plan tests => 3;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Catalyst::Log;
+
+my @warnings;
+
+my $log = Catalyst::Log->new;
+my $mock_log = Test::MockObject::Extends->new($log);
+$mock_log->mock(warn => sub { push @warnings, $_[1] });
+
+{
+ no warnings 'once';
+ $::fake_log = $mock_log;
+}
+
+use_ok('Catalyst::Test', 'TestApp');
+
+is(scalar @warnings, 1, 'loading component which sets use_match to something true causes a warning');
+like($warnings[0], qr/^DEPRECATION WARNING/, 'the warning is a deprecation warning');
More information about the Catalyst-commits
mailing list