X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_setup_log.t;h=679504791bdbdea72e0ed762674d8fc7c76eef18;hp=9e80cf4f2742b846c3cd38f542c286464324f6c4;hb=53c7cc10e26c965f7502936609c5d1e6a35dc819;hpb=310c2a39c86dc3f8a1dd0bb80c2543e809e2cb3c diff --git a/t/aggregate/unit_core_setup_log.t b/t/aggregate/unit_core_setup_log.t index 9e80cf4..6795047 100644 --- a/t/aggregate/unit_core_setup_log.t +++ b/t/aggregate/unit_core_setup_log.t @@ -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, ); } {