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=d2d007f49d5e9b06f0d1a6f38fc9ac8ac3306183;hp=1406944eb032d450db7f56bc9c47d7f29419accb;hpb=5d50f369bffa3625ca983b72fc8bc013c8a1e802;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/unit_core_setup_log.t b/t/aggregate/unit_core_setup_log.t index 1406944..6795047 100644 --- a/t/aggregate/unit_core_setup_log.t +++ b/t/aggregate/unit_core_setup_log.t @@ -2,16 +2,24 @@ use strict; use warnings; use Test::More tests => 30; -use Test::Exception; use Catalyst (); sub mock_app { my $name = shift; - print "Setting up mock application: $name\n"; 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 {