X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Funit_core_log.t;h=9d500380c43fef19da8e0bd0d52a8386f5d0fea7;hp=c86aa82fac7d9212d598e246ef07d8c03c264dc5;hb=10f9ef88e69b504106ed9e5cefa1088ccaf3308d;hpb=5d50f369bffa3625ca983b72fc8bc013c8a1e802 diff --git a/t/aggregate/unit_core_log.t b/t/aggregate/unit_core_log.t index c86aa82..9d50038 100644 --- a/t/aggregate/unit_core_log.t +++ b/t/aggregate/unit_core_log.t @@ -1,13 +1,12 @@ use strict; use warnings; -use Test::More tests => 23; +use Test::More tests => 24; use Catalyst::Log; local *Catalyst::Log::_send_to_log; - -my @MESSAGES; +local our @MESSAGES; { no warnings 'redefine'; *Catalyst::Log::_send_to_log = sub { @@ -22,6 +21,9 @@ can_ok $LOG, 'new'; ok my $log = $LOG->new, '... and creating a new log object should succeed'; isa_ok $log, $LOG, '... and the object it returns'; +can_ok $log, "autoflush"; +$log->autoflush(0); + can_ok $log, 'is_info'; ok $log->is_info, '... and the default behavior is to allow info messages'; @@ -51,10 +53,13 @@ like $MESSAGES[0], qr/^\[info\] hello there!$/, my $SUBCLASS = 'Catalyst::Log::Subclass'; can_ok $SUBCLASS, 'new'; ok $log = Catalyst::Log::Subclass->new, - '... and the log subclass constructor shoudl return a new object'; + '... and the log subclass constructor should return a new object'; isa_ok $log, $SUBCLASS, '... and the object it returns'; isa_ok $log, $LOG, '... and it also'; +can_ok $log, "autoflush"; +$log->autoflush(0); + can_ok $log, 'info'; ok $log->info('hi there!'), '... passing it an info message should succeed';