[Catalyst-commits] r13653 - in Catalyst-View-TT/trunk:
lib/Catalyst/View t t/lib/TestApp/View/TT
abraxxa at dev.catalyst.perl.org
abraxxa at dev.catalyst.perl.org
Mon Oct 11 17:19:30 GMT 2010
Author: abraxxa
Date: 2010-10-11 18:19:30 +0100 (Mon, 11 Oct 2010)
New Revision: 13653
Added:
Catalyst-View-TT/trunk/t/lib/TestApp/View/TT/ExposeMethodsSubclassed.pm
Modified:
Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm
Catalyst-View-TT/trunk/t/12expose_methods.t
Log:
fixed subclassing when using expose_methods + test
Modified: Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm
===================================================================
--- Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm 2010-10-08 14:51:49 UTC (rev 13652)
+++ Catalyst-View-TT/trunk/lib/Catalyst/View/TT.pm 2010-10-11 17:19:30 UTC (rev 13653)
@@ -278,7 +278,7 @@
if ($self->expose_methods) {
my $meta = $self->meta;
foreach my $method_name (@{$self->expose_methods}) {
- my $method = $meta->get_method( $method_name );
+ my $method = $meta->find_method_by_name( $method_name );
unless ($method) {
Catalyst::Exception->throw( "$method_name not found in TT view" );
}
Modified: Catalyst-View-TT/trunk/t/12expose_methods.t
===================================================================
--- Catalyst-View-TT/trunk/t/12expose_methods.t 2010-10-08 14:51:49 UTC (rev 13652)
+++ Catalyst-View-TT/trunk/t/12expose_methods.t 2010-10-11 17:19:30 UTC (rev 13653)
@@ -1,6 +1,6 @@
use strict;
use warnings;
-use Test::More tests => 3;
+use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
@@ -10,3 +10,7 @@
my $response;
ok(($response = request("/test?view=ExposeMethods&template=expose_methods.tt"))->is_success, 'request ok');
is($response->content, "magic added param", 'message ok');
+ok(($response = request("/test?view=ExposeMethodsSubclassed&template=expose_methods.tt"))->is_success, 'request ok');
+is($response->content, "magic added param", 'message ok');
+
+done_testing;
Added: Catalyst-View-TT/trunk/t/lib/TestApp/View/TT/ExposeMethodsSubclassed.pm
===================================================================
--- Catalyst-View-TT/trunk/t/lib/TestApp/View/TT/ExposeMethodsSubclassed.pm (rev 0)
+++ Catalyst-View-TT/trunk/t/lib/TestApp/View/TT/ExposeMethodsSubclassed.pm 2010-10-11 17:19:30 UTC (rev 13653)
@@ -0,0 +1,6 @@
+package TestApp::View::TT::ExposeMethodsSubclassed;
+
+use Moose;
+extends 'TestApp::View::TT::ExposeMethods';
+
+1;
More information about the Catalyst-commits
mailing list