silence warnings in tests
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_core_setup_log.t
index 9e80cf4..6795047 100644 (file)
@@ -9,7 +9,17 @@ sub mock_app {
     my $name = shift;
     my $meta = Moose->init_meta( for_class => $name );
     $meta->superclasses('Catalyst');
-    return $meta->name;
+
+    $meta->add_after_method_modifier('log', sub {
+        my ($self, $log) = @_;
+        if ($log) {
+            open my $err_fh, '>', \(my $err_out)
+                or die 'unable to open in memory buffer';
+            $log->psgienv({ 'psgi.errors' => $err_fh });
+        }
+    });
+
+    return $name;
 }
 
 sub test_log_object {
@@ -76,13 +86,13 @@ foreach my $name (grep { /^(CATALYST|TESTAPP)/ } keys %ENV) {
     my $app = mock_app('TestAppLogEmptyString');
     $app->setup_log('');
     ok !$app->debug, 'Not In debug mode';
-    # Note that by default, you get _all_ the log levels turned on over debug
+    # Note that by default, you get _all_ the log levels turned on
     test_log_object($app->log,
         fatal => 1,
         error => 1,
         warn => 1,
         info => 1,
-        debug => 0,
+        debug => 1,
     );
 }
 {