use inlined module hiding in tests
[catagits/Catalyst-Runtime.git] / t / aggregate / unit_controller_actions.t
1 use strict;
2 use warnings;
3 use Test::More tests => 4;
4
5 use Catalyst ();
6 {
7     package TestController;
8     use Moose;
9     BEGIN { extends 'Catalyst::Controller' }
10
11     sub action : Local {}
12
13     sub foo : Path {}
14
15     no Moose;
16 }
17
18 my $mock_app = Class::MOP::Class->create_anon_class( superclasses => ['Catalyst'] );
19 my $app = $mock_app->name->new;
20 my $controller = TestController->new($app, {actions => { foo => { Path => '/some/path' }}});
21
22 ok $controller->can('_controller_actions');
23 is_deeply $controller->_controller_actions => { foo => { Path => '/some/path' }};
24 is_deeply $controller->{actions} => { foo => { Path => '/some/path' }}; # Back compat.
25 is_deeply [ sort grep { ! /^_/ } map { $_->name } $controller->get_action_methods ], [sort qw/action foo/];
26