X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Funit_core_setup_log.t;h=679504791bdbdea72e0ed762674d8fc7c76eef18;hb=4e93cdb6d9403718baff430bc1bdc3245aa5236f;hp=e2dba17f8926dc2365da292529886417cb8c70af;hpb=be5fd858fdd2f1776bd389e89fdb65788a651a3a;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_setup_log.t b/t/aggregate/unit_core_setup_log.t index e2dba17..6795047 100644 --- a/t/aggregate/unit_core_setup_log.t +++ b/t/aggregate/unit_core_setup_log.t @@ -2,7 +2,6 @@ use strict; use warnings; use Test::More tests => 30; -use Test::Exception; use Catalyst (); @@ -10,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 {