From: Tomas Doran Date: Wed, 12 Aug 2009 01:09:09 +0000 (+0000) Subject: Split test out into a more proper app, so that the test no longer relies on the metac... X-Git-Tag: 5.80008~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c68a3c90180235a2a464ce237a96fef79db468bf Split test out into a more proper app, so that the test no longer relies on the metaclass initialization hacking occurring in ->setup_component, as I want to move it --- diff --git a/t/lib/TestAppNonMooseController.pm b/t/lib/TestAppNonMooseController.pm new file mode 100644 index 0000000..8507aba --- /dev/null +++ b/t/lib/TestAppNonMooseController.pm @@ -0,0 +1,8 @@ +package TestAppNonMooseController; +use base qw/Catalyst/; +use Catalyst; + +__PACKAGE__->setup; + +1; + diff --git a/t/lib/TestAppNonMooseController/Controller/Foo.pm b/t/lib/TestAppNonMooseController/Controller/Foo.pm new file mode 100644 index 0000000..36b036c --- /dev/null +++ b/t/lib/TestAppNonMooseController/Controller/Foo.pm @@ -0,0 +1,5 @@ +package TestAppNonMooseController::Controller::Foo; +use base qw/TestAppNonMooseController::ControllerBase/; + +1; + diff --git a/t/lib/TestAppNonMooseController/ControllerBase.pm b/t/lib/TestAppNonMooseController/ControllerBase.pm new file mode 100644 index 0000000..406df4b --- /dev/null +++ b/t/lib/TestAppNonMooseController/ControllerBase.pm @@ -0,0 +1,5 @@ +package TestAppNonMooseController::ControllerBase; +use base qw/Catalyst::Controller/; + +1; + diff --git a/t/unit_metaclass_compat_non_moose_controller.t b/t/unit_metaclass_compat_non_moose_controller.t index cb3c1e2..3b91ef2 100644 --- a/t/unit_metaclass_compat_non_moose_controller.t +++ b/t/unit_metaclass_compat_non_moose_controller.t @@ -1,23 +1,12 @@ -use Catalyst (); +use strict; +use warnings; -{ - package TestApp; - use base qw/Catalyst/; -} -{ - package TestApp::Controller::Base; - use base qw/Catalyst::Controller/; -} -{ - package TestApp::Controller::Other; - use base qw/TestApp::Controller::Base/; -} - -TestApp->setup_component('TestApp::Controller::Other'); -TestApp->setup_component('TestApp::Controller::Base'); +use FindBin; +use lib "$FindBin::Bin/lib"; use Test::More tests => 1; use Test::Exception; +use TestAppNonMooseController; # Metaclass init order causes fail. # There are TODO tests in Moose for this, see @@ -25,6 +14,6 @@ use Test::Exception; # after which the evil kludge in core can die in a fire. lives_ok { - TestApp::Controller::Base->get_action_methods + TestAppNonMooseController::ControllerBase->get_action_methods } 'Base class->get_action_methods ok when sub class initialized first';