[Catalyst-commits] r9372 - Catalyst-Runtime/5.80/trunk/t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Fri Feb 20 16:58:51 GMT 2009


Author: t0m
Date: 2009-02-20 16:58:50 +0000 (Fri, 20 Feb 2009)
New Revision: 9372

Modified:
   Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t
Log:
Shut up warnings we don't care about and are explicitly testing elsewhere

Modified: Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t	2009-02-20 16:58:43 UTC (rev 9371)
+++ Catalyst-Runtime/5.80/trunk/t/unit_core_component_loading.t	2009-02-20 16:58:50 UTC (rev 9372)
@@ -9,6 +9,8 @@
 use File::Spec;
 use File::Path;
 
+use Test::MockObject;
+
 my $libdir = 'test_trash';
 unshift(@INC, $libdir);
 
@@ -63,7 +65,7 @@
 
     write_component_file(\@dir_list, $name_final, <<EOF);
 package $fullname;
-use Class::C3;
+use MRO::Compat;
 use base '$compbase';
 sub COMPONENT {
     my \$self = shift->next::method(\@_);
@@ -82,8 +84,20 @@
                         $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');
 
 my $complist = $appclass->components;
@@ -141,6 +155,7 @@
 eval qq(
 package $appclass;
 use Catalyst;
+$shut_up_deprecated_warnings
 __PACKAGE__->config->{ setup_components } = {
     search_extra => [ '::Extra' ],
     except       => [ "${appclass}::Controller::Foo" ]




More information about the Catalyst-commits mailing list