test_requires 'Catalyst::Test';
test_requires 'FindBin';
-test_requires 'Test::More', '0.86';
+test_requires 'Test::More', '0.92';
repository 'http://github.com/phaylon/catalystx-declarative/tree/master';
bugtracker 'http://github.com/phaylon/catalystx-declarative/issues';
in the future plugins will be actual roles.
You don't have to call the C<setup> method yourself, this will be done by the
-handler after the body has been run. If you need to run code specifically before
-or after the C<setup> method has been run, you can always use method modifiers.
+handler after the body has been run.
=head1 SUPERCLASSES
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More;
+
+use Catalyst::Test 'TestApp';
+
+is(TestApp->config->{name}, 'CatalystX::Declare TestApp', 'config setting via $CLASS');
+is(TestApp->ctx_method(23), 23, 'calling context method');
+is(TestApp->cx_declare_test_plugin_method, 'plugin', 'plugin is available');
+
+done_testing;
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More;
+
+use aliased 'TestApp::TestRole';
+
+ok +(my $meta = TestRole->meta), 'controller role has meta';
+
+ok $meta->has_method('something_from_the_role'), 'method is available in role';
+ok $meta->has_method('action_from_ctrl_role'), 'action method is available in role';
+
+done_testing;
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More;
+
+use aliased 'TestApp::Controller::TestController';
+
+ok +(my $meta = TestController->meta), 'controller has meta';
+
+ok $meta->has_method('ctrl_method'), 'method is available in controller';
+ok $meta->has_method('ctrl_action'), 'action method is available in controller';
+
+done_testing;
--- /dev/null
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+use Test::More;
+
+use aliased 'TestApp::Controller::Composed';
+
+ok +(my $meta = Composed->meta), 'controller has meta';
+
+ok $meta->find_method_by_name($_), "method $_ is available in composed controller"
+ for qw(
+ original_method
+ original_action
+ inherited_method
+ inherited_action
+ composed_method
+ composed_action
+ );
+
+done_testing;
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 21;
+use Test::More;
use Catalyst::Test 'TestApp';
# simple stuff
# inline classes
is get('/foo/inline_class'), 'HELLO', 'inline classes work as expected';
+
+
+done_testing;
--- /dev/null
+package Catalyst::Plugin::CatalystX::Declare::TestPlugin;
+use strict;
+use warnings;
+
+sub cx_declare_test_plugin_method { 'plugin' }
+
+1;
use CatalystX::Declare;
-application TestApp with Static::Simple {
+application TestApp with CatalystX::Declare::TestPlugin {
$CLASS->config(name => 'CatalystX::Declare TestApp');
+
+ method ctx_method (ClassName $app: $arg) { $arg }
}
--- /dev/null
+use CatalystX::Declare;
+
+controller_role TestApp::ControllerRole::Composed {
+ method composed_method { }
+ action composed_action;
+}
+
+controller TestApp::ControllerBase::Composed {
+ method inherited_method { }
+ action inherited_action;
+}
+
+controller TestApp::Controller::Composed
+ extends TestApp::ControllerBase::Composed
+ with TestApp::ControllerRole::Composed {
+
+ method original_method { }
+ action original_action;
+}
--- /dev/null
+use CatalystX::Declare;
+
+controller TestApp::Controller::TestController {
+
+ method ctrl_method { }
+
+ action ctrl_action;
+}