From: Tomas Doran Date: Fri, 20 Feb 2009 16:58:50 +0000 (+0000) Subject: Shut up warnings we don't care about and are explicitly testing elsewhere X-Git-Tag: 5.80001~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=f27f2c6dee65b9f6f18f2ff90ab337e97a585fed Shut up warnings we don't care about and are explicitly testing elsewhere --- diff --git a/t/unit_core_component_loading.t b/t/unit_core_component_loading.t index 6b9f8da..d27b9b7 100644 --- a/t/unit_core_component_loading.t +++ b/t/unit_core_component_loading.t @@ -9,6 +9,8 @@ use warnings; use File::Spec; use File::Path; +use Test::MockObject; + my $libdir = 'test_trash'; unshift(@INC, $libdir); @@ -63,7 +65,7 @@ sub make_component_file { write_component_file(\@dir_list, $name_final, <next::method(\@_); @@ -82,7 +84,19 @@ foreach my $component (@components) { $component->{name}); } -eval "package $appclass; use Catalyst; __PACKAGE__->setup"; +my $shut_up_deprecated_warnings = q{ + use Test::MockObject; + my $old_logger = __PACKAGE__->log; + my $logger = Test::MockObject->new; + $logger->mock('warn', sub { + my $self = shift; + return if $_[0] =~ /deprecated/; + $old_logger->warn(@_); + }); + __PACKAGE__->log($logger); +}; + +eval "package $appclass; use Catalyst; $shut_up_deprecated_warnings __PACKAGE__->setup"; can_ok( $appclass, 'components'); @@ -141,6 +155,7 @@ foreach my $component (@components) { eval qq( package $appclass; use Catalyst; +$shut_up_deprecated_warnings __PACKAGE__->config->{ setup_components } = { search_extra => [ '::Extra' ], except => [ "${appclass}::Controller::Foo" ]