stop using Moo as a test package
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_action_index_or_default.t
CommitLineData
2ee0056e 1use strict;
2use warnings;
3
4use FindBin;
5use lib "$FindBin::Bin/../lib";
6
7our $iters;
8
9BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
10
81f25ce6 11use Test::More;
05b47f2e 12use Catalyst::Test 'TestAppIndexDefault';
2ee0056e 13
81f25ce6 14plan 'skip_all' if ( $ENV{CATALYST_SERVER} );
15
16plan tests => 6*$iters;
17
2ee0056e 18if ( $ENV{CAT_BENCHMARK} ) {
19 require Benchmark;
20 Benchmark::timethis( $iters, \&run_tests );
21}
22else {
23 for ( 1 .. $iters ) {
24 run_tests();
25 }
26}
27
28sub run_tests {
29 is(get('/indexchained'), 'index_chained', ':Chained overrides index');
05b47f2e 30 is(get('/indexprivate'), 'index_private', 'index : Private still works');
5299fff8 31
32# test :Path overriding default
91955398 33 is(get('/one_arg'), 'path_one_arg', ':Path overrides default');
5299fff8 34 is(get('/one_arg/foo/bar'), 'default', 'default still works');
35
36# now the same thing with a namespace, and a trailing / on the :Path
37 is(get('/default/one_arg'), 'default_path_one_arg',
38 ':Path overrides default');
39 is(get('/default/one_arg/foo/bar'), 'default_default',
40 'default still works');
2ee0056e 41}