[Catalyst-commits] r11433 - Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sun Sep 27 15:06:37 GMT 2009


Author: rafl
Date: 2009-09-27 15:06:36 +0000 (Sun, 27 Sep 2009)
New Revision: 11433

Modified:
   Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_component_loading.t
   Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_log.t
   Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_plugin.t
   Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_setup_stats.t
Log:
Fix a couple of aggregation warnings.

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_component_loading.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_component_loading.t	2009-09-27 15:06:26 UTC (rev 11432)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_component_loading.t	2009-09-27 15:06:36 UTC (rev 11433)
@@ -11,6 +11,7 @@
 use File::Path;
 
 my $libdir = 'test_trash';
+local @INC = @INC;
 unshift(@INC, $libdir);
 
 my $appclass = 'TestComponents';
@@ -54,7 +55,7 @@
 }
 
 sub make_component_file {
-    my ($type, $prefix, $name) = @_;
+    my ($libdir, $appclass, $type, $prefix, $name) = @_;
 
     my $compbase = "Catalyst::${type}";
     my $fullname = "${appclass}::${prefix}::${name}";
@@ -78,9 +79,13 @@
 }
 
 foreach my $component (@components) {
-    make_component_file($component->{type},
-                        $component->{prefix},
-                        $component->{name});
+    make_component_file(
+        $libdir,
+        $appclass,
+        $component->{type},
+        $component->{prefix},
+        $component->{name},
+    );
 }
 
 my $shut_up_deprecated_warnings = q{
@@ -138,9 +143,13 @@
 push @components, { type => 'View', prefix => 'Extra', name => 'Foo' };
 
 foreach my $component (@components) {
-    make_component_file($component->{type},
-                        $component->{prefix},
-                        $component->{name});
+    make_component_file(
+        $libdir,
+        $appclass,
+        $component->{type},
+        $component->{prefix},
+        $component->{name},
+    );
 }
 
 eval qq(

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_log.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_log.t	2009-09-27 15:06:26 UTC (rev 11432)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_log.t	2009-09-27 15:06:36 UTC (rev 11433)
@@ -6,8 +6,7 @@
 use Catalyst::Log;
 
 local *Catalyst::Log::_send_to_log;
-
-my @MESSAGES;
+local our @MESSAGES;
 {
     no warnings 'redefine';
     *Catalyst::Log::_send_to_log = sub {

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_plugin.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_plugin.t	2009-09-27 15:06:26 UTC (rev 11432)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_plugin.t	2009-09-27 15:06:36 UTC (rev 11433)
@@ -11,9 +11,8 @@
 
     package Faux::Plugin;
 
-    sub new { bless {}, shift }
-    my $count = 1;
-    sub count { $count++ }
+    sub new { bless { count => 1 }, shift }
+    sub count { shift->{count}++ }
 }
 
 my $warnings = 0;

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_setup_stats.t
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_setup_stats.t	2009-09-27 15:06:26 UTC (rev 11432)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/aggregate/unit_core_setup_stats.t	2009-09-27 15:06:36 UTC (rev 11433)
@@ -6,7 +6,7 @@
 
 use Catalyst ();
 
-my %log_messages; # TODO - Test log messages as expected.
+local our %log_messages; # TODO - Test log messages as expected.
 my $mock_log = Class::MOP::Class->create_anon_class(
     methods => {
         map { my $level = $_;
@@ -21,6 +21,7 @@
 
 sub mock_app {
     my $name = shift;
+    my $mock_log = shift;
     %log_messages = (); # Flatten log messages.
     my $meta = Moose->init_meta( for_class => $name );
     $meta->superclasses('Catalyst');
@@ -36,17 +37,17 @@
 }
 
 {
-    my $app = mock_app('TestAppNoStats');
+    my $app = mock_app('TestAppNoStats', $mock_log);
     $app->setup_stats();
     ok !$app->use_stats, 'stats off by default';
 }
 {
-    my $app = mock_app('TestAppStats');
+    my $app = mock_app('TestAppStats', $mock_log);
     $app->setup_stats(1);
     ok $app->use_stats, 'stats on if you say >setup_stats(1)';
 }
 {
-    my $app = mock_app('TestAppStatsDebugTurnsStatsOn');
+    my $app = mock_app('TestAppStatsDebugTurnsStatsOn', $mock_log);
     $app->meta->add_method('debug' => sub { 1 });
     $app->setup_stats();
     ok $app->use_stats, 'debug on turns stats on';
@@ -54,14 +55,14 @@
 {
     local %ENV = %ENV;
     $ENV{CATALYST_STATS} = 1;
-    my $app = mock_app('TestAppStatsEnvSet');
+    my $app = mock_app('TestAppStatsEnvSet', $mock_log);
     $app->setup_stats();
     ok $app->use_stats, 'ENV turns stats on';
 }
 {
     local %ENV = %ENV;
     $ENV{CATALYST_STATS} = 0;
-    my $app = mock_app('TestAppStatsEnvUnset');
+    my $app = mock_app('TestAppStatsEnvUnset', $mock_log);
     $app->meta->add_method('debug' => sub { 1 });
     $app->setup_stats(1);
     ok !$app->use_stats, 'ENV turns stats off, even when debug on and ->setup_stats(1)';




More information about the Catalyst-commits mailing list