[Catalyst-commits] r11208 - in Catalyst-View-Mason/trunk:
lib/Catalyst/View t t/lib t/lib/TestApp/View/Mason
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sat Aug 22 19:14:50 GMT 2009
Author: rafl
Date: 2009-08-22 19:14:50 +0000 (Sat, 22 Aug 2009)
New Revision: 11208
Added:
Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/NoMatch.pm
Modified:
Catalyst-View-Mason/trunk/lib/Catalyst/View/Mason.pm
Catalyst-View-Mason/trunk/t/action.t
Catalyst-View-Mason/trunk/t/deprecation.t
Catalyst-View-Mason/trunk/t/lib/TestApp.pm
Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Match.pm
Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Pkgconfig.pm
Catalyst-View-Mason/trunk/t/match.t
Log:
Fix a shitload of warnings.
Modified: Catalyst-View-Mason/trunk/lib/Catalyst/View/Mason.pm
===================================================================
--- Catalyst-View-Mason/trunk/lib/Catalyst/View/Mason.pm 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/lib/Catalyst/View/Mason.pm 2009-08-22 19:14:50 UTC (rev 11208)
@@ -72,7 +72,6 @@
sub new {
my ($self, $app, $arguments) = @_;
- delete $arguments->{catalyst_component_name};
my %config = (
comp_root => $app->config->{root},
data_dir => File::Spec->catdir(
@@ -105,6 +104,7 @@
use_match
template_extension
always_append_template_extension
+ catalyst_component_name
/};
if ($self->config->{use_match}) {
Modified: Catalyst-View-Mason/trunk/t/action.t
===================================================================
--- Catalyst-View-Mason/trunk/t/action.t 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/action.t 2009-08-22 19:14:50 UTC (rev 11208)
@@ -9,5 +9,5 @@
use_ok('Catalyst::Test', 'TestApp');
-my $request = request('/action_match/foo?view=Match');
+my $request = request('/action_match/foo?view=NoMatch');
ok($request->is_success, 'request ok');
Modified: Catalyst-View-Mason/trunk/t/deprecation.t
===================================================================
--- Catalyst-View-Mason/trunk/t/deprecation.t 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/deprecation.t 2009-08-22 19:14:50 UTC (rev 11208)
@@ -16,10 +16,11 @@
{
no warnings 'once';
$::fake_log = $mock_log;
+ $::setup_match = 1;
}
use_ok('Catalyst::Test', 'TestApp');
is(scalar @warnings, 1, 'loading component which sets use_match to something true causes a warning');
like($warnings[0], qr/^DEPRECATION WARNING/, 'the warning is a deprecation warning');
-like($warnings[0], qr/TestApp::View::Mason::Pkgconfig/, 'the warning contains the name of the component causing it');
+like($warnings[0], qr/TestApp::View::Mason::Match/, 'the warning contains the name of the component causing it');
Modified: Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Match.pm
===================================================================
--- Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Match.pm 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Match.pm 2009-08-22 19:14:50 UTC (rev 11208)
@@ -5,7 +5,7 @@
use base qw/Catalyst::View::Mason/;
__PACKAGE__->config(
- use_match => 0,
+ use_match => 1,
);
1;
Copied: Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/NoMatch.pm (from rev 11198, Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Match.pm)
===================================================================
--- Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/NoMatch.pm (rev 0)
+++ Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/NoMatch.pm 2009-08-22 19:14:50 UTC (rev 11208)
@@ -0,0 +1,11 @@
+package TestApp::View::Mason::NoMatch;
+
+use strict;
+use warnings;
+use base qw/Catalyst::View::Mason/;
+
+__PACKAGE__->config(
+ use_match => 0,
+);
+
+1;
Modified: Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Pkgconfig.pm
===================================================================
--- Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Pkgconfig.pm 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/lib/TestApp/View/Mason/Pkgconfig.pm 2009-08-22 19:14:50 UTC (rev 11208)
@@ -6,7 +6,7 @@
__PACKAGE__->config(
allow_globals => [qw/$foo @bar/],
- use_match => 1,
+ use_match => 0,
);
if ($::use_path_class) {
Modified: Catalyst-View-Mason/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-View-Mason/trunk/t/lib/TestApp.pm 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/lib/TestApp.pm 2009-08-22 19:14:50 UTC (rev 11208)
@@ -23,7 +23,10 @@
__PACKAGE__->config(
setup_components => {
- except => qr/^View::Mason::CompRootRef$/,
+ except => [
+ 'TestApp::View::Mason::CompRootRef',
+ ($::setup_match ? () : 'TestApp::View::Mason::Match'),
+ ],
},
);
@@ -106,7 +109,7 @@
return 1 if $c->response->body;
my ($requested_view) = $c->request->param('view');
- $c->forward($c->view( $requested_view ? $requested_view : () ));
+ $c->forward($c->view( $requested_view ? "Mason::$requested_view" : () ));
}
1;
Modified: Catalyst-View-Mason/trunk/t/match.t
===================================================================
--- Catalyst-View-Mason/trunk/t/match.t 2009-08-22 17:10:27 UTC (rev 11207)
+++ Catalyst-View-Mason/trunk/t/match.t 2009-08-22 19:14:50 UTC (rev 11208)
@@ -7,8 +7,16 @@
use FindBin;
use lib "$FindBin::Bin/lib";
+use TestApp::FakeLog;
+
+{
+ no warnings 'once';
+ $::setup_match = 1;
+ $::fake_log = TestApp::FakeLog->new([]);
+}
+
use_ok('Catalyst::Test', 'TestApp');
-my $response = request('/match/foo?view=Pkgconfig');
+my $response = request('/match/foo?view=Match');
ok($response->is_success, 'request ok');
is($response->content, 'foo');
More information about the Catalyst-commits
mailing list