[Catalyst-commits] r10080 - in Catalyst-Runtime/5.80/trunk/t: . lib
lib/TestAppWithMeta lib/TestAppWithMeta/Controller
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Mon May 11 23:16:31 GMT 2009
Author: t0m
Date: 2009-05-11 23:16:31 +0000 (Mon, 11 May 2009)
New Revision: 10080
Added:
Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/
Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/Controller/
Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/Controller/Root.pm
Modified:
Catalyst-Runtime/5.80/trunk/t/meta_method_unneeded.t
Log:
Add test controller with its own meta method, still works
Added: Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/Controller/Root.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/Controller/Root.pm (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestAppWithMeta/Controller/Root.pm 2009-05-11 23:16:31 UTC (rev 10080)
@@ -0,0 +1,19 @@
+package TestAppWithMeta::Controller::Root;
+use Moose;
+use namespace::clean -except => 'meta';
+
+BEGIN { extends 'Catalyst::Controller' }
+
+__PACKAGE__->config( namespace => '' );
+
+no warnings 'redefine';
+sub meta { 'fnar' }
+use warnings 'redefine';
+
+sub default : Private {
+ my ($self, $c) = @_;
+ $c->res->body($self->meta);
+}
+
+1;
+
Modified: Catalyst-Runtime/5.80/trunk/t/meta_method_unneeded.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/meta_method_unneeded.t 2009-05-11 18:54:33 UTC (rev 10079)
+++ Catalyst-Runtime/5.80/trunk/t/meta_method_unneeded.t 2009-05-11 23:16:31 UTC (rev 10080)
@@ -1,12 +1,13 @@
use strict;
use warnings;
-use Test::More tests => 1;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
+use Test::More tests => 2;
use Test::Exception;
use Carp ();
-$SIG{__DIE__} = \&Carp::confess; # Stacktrace please.
# Doing various silly things, like for example
-# use CGI qw/:stanard/ in your conrtoller / app
+# use CGI qw/:standard/ in your conrtoller / app
# will overwrite your meta method, therefore Catalyst
# can't depend on it being there correctly.
@@ -19,5 +20,11 @@
no warnings 'redefine';
sub meta {}
}
+BEGIN {
+ lives_ok { TestAppWithMeta->setup } 'Can setup an app which defines its own meta method';
+}
-lives_ok { TestAppWithMeta->setup } 'Can setup an app which defines its own meta method';
+use Catalyst::Test 'TestAppWithMeta';
+
+ok( request('/')->is_success );
+
More information about the Catalyst-commits
mailing list