X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Funit_core_setup.t;h=70b649ee14df8e14aee6be1a9a8b13c0eff0778e;hp=311320f2925845ee9890eef7168ba4ec40d0a659;hb=19a24dbb5b7329841b77ce80102c85c6bb137dee;hpb=0fa676a79aa572c22884b48560683f21f596fe45 diff --git a/t/unit_core_setup.t b/t/unit_core_setup.t index 311320f..70b649e 100644 --- a/t/unit_core_setup.t +++ b/t/unit_core_setup.t @@ -2,7 +2,7 @@ use strict; use warnings; use Catalyst::Runtime; -use Test::More tests => 18; +use Test::More tests => 20; { # Silence the log. @@ -12,7 +12,7 @@ use Test::More tests => 18; TESTDEBUG: { package MyTestDebug; - use parent qw/Catalyst/; + use base qw/Catalyst/; __PACKAGE__->setup( '-Debug', ); @@ -32,7 +32,7 @@ ok +MyTestDebug->debug, 'And it should return true'; TESTAPP: { package MyTestLog; - use parent qw/Catalyst/; + use base qw/Catalyst/; __PACKAGE__->setup( '-Log=warn,error,fatal' ); @@ -46,3 +46,16 @@ ok $log->is_error, 'Errors should be enabled'; ok $log->is_fatal, 'Fatal errors should be enabled'; ok !$log->is_info, 'Info should be disabled'; ok !$log->is_debug, 'Debugging should be disabled'; + +TESTOWNLOGGER: { + package MyTestAppWithOwnLogger; + use base qw/Catalyst/; + use Test::MockObject; + my $log = Test::MockObject->new; + $log->set_false(qw/debug error fatal info warn/); + __PACKAGE__->log($log); + __PACKAGE__->setup('-Debug'); +} + +ok $c = MyTestAppWithOwnLogger->new, 'Get with own logger app object'; +ok $c->debug, '$c->debug is true';