Shut up log output from Catalyst with null log object
Dave Rolsky [Sun, 17 Jan 2010 22:22:38 +0000 (16:22 -0600)]
t/lib/Test/Catalyst/Action/REST.pm
t/lib/Test/Catalyst/Log.pm [new file with mode: 0644]
t/lib/Test/Serialize.pm

index 2477354..c6422bd 100644 (file)
@@ -7,6 +7,7 @@ use Catalyst::Runtime '5.70';
 
 use Catalyst;
 use FindBin;
+use Test::Catalyst::Log;
 
 __PACKAGE__->config(
     name => 'Test::Catalyst::Action::REST',
@@ -16,5 +17,6 @@ __PACKAGE__->config(
     },
 );
 __PACKAGE__->setup;
+__PACKAGE__->log( Test::Catalyst::Log->new );
 
 1;
diff --git a/t/lib/Test/Catalyst/Log.pm b/t/lib/Test/Catalyst/Log.pm
new file mode 100644 (file)
index 0000000..ba41c73
--- /dev/null
@@ -0,0 +1,21 @@
+package Test::Catalyst::Log;
+
+use strict;
+use warnings;
+
+sub new {
+    bless {}, __PACKAGE__;
+}
+
+sub is_debug { 0 }
+sub debug { }
+sub is_info { 0 }
+sub info { }
+sub is_warn { 0 }
+sub warn : method { }
+sub is_error { 0 }
+sub error { }
+sub is_fatal { 0 }
+sub fatal { }
+
+1;
index 29808b3..432f91c 100644 (file)
@@ -10,12 +10,14 @@ use namespace::autoclean;
 use Catalyst::Runtime '5.70';
 
 use Catalyst;
+use Test::Catalyst::Log;
 
 __PACKAGE__->config(
     name => 'Test::Serialize',
 );
 
 __PACKAGE__->setup;
+__PACKAGE__->log( Test::Catalyst::Log->new );
 
 1;