[Catalyst-commits] r13501 -
Catalyst-Runtime/5.80/branches/refactor_debug/t/aggregate
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Thu Aug 19 03:43:35 GMT 2010
Author: frew
Date: 2010-08-19 04:43:35 +0100 (Thu, 19 Aug 2010)
New Revision: 13501
Added:
Catalyst-Runtime/5.80/branches/refactor_debug/t/aggregate/unit_core_debug.t
Log:
initial test for new debug functionality
Added: Catalyst-Runtime/5.80/branches/refactor_debug/t/aggregate/unit_core_debug.t
===================================================================
--- Catalyst-Runtime/5.80/branches/refactor_debug/t/aggregate/unit_core_debug.t (rev 0)
+++ Catalyst-Runtime/5.80/branches/refactor_debug/t/aggregate/unit_core_debug.t 2010-08-19 03:43:35 UTC (rev 13501)
@@ -0,0 +1,56 @@
+use Test::More 'no_plan';
+use strict;
+use warnings;
+
+use_ok('Catalyst');
+
+no warnings 'redefine';
+local *Catalyst::Log::debug = sub { };
+local *Catalyst::Log::info = sub { };
+
+{
+ package DefaultTestApp;
+
+ use Catalyst;
+
+ __PACKAGE__->setup;
+}
+
+ok( !DefaultTestApp->debug, 'debug mode is off by default' );
+
+{
+ package DebugTestApp;
+
+ use Catalyst '-Debug';
+
+ __PACKAGE__->setup;
+}
+
+ok( DebugTestApp->debug, 'debug mode is on' );
+ok( DebugTestApp->log->is_debug, 'log debug mode is on' );
+
+{
+ package ModernTestApp;
+
+ use Catalyst;
+
+ __PACKAGE__->config(
+ log => 'debug'
+ );
+
+ __PACKAGE__->setup;
+}
+
+ok( !ModernTestApp->debug, 'debug mode is off' );
+ok( ModernTestApp->log->is_debug, '... but the logger does turn on the debug mode' );
+
+{
+ package AncientTestApp;
+
+ use Catalyst '-Log=debug';
+
+ __PACKAGE__->setup;
+}
+
+ok( AncientTestApp->debug, 'debug mode is on' );
+ok( AncientTestApp->log->is_debug, '... and the logger does turn on the debug mode' );
More information about the Catalyst-commits
mailing list