VERSION var
[blog.pm-common-perl-mods.git] / MojoX-Dispatcher-FilterChain / t / 03chain.t
blobfab023df85a09517946fce5adcd0a8f9efb487f6
1 #!perl
3 use strict;
4 use warnings;
6 use Test::More tests => 1;
8 use_ok('MojoX::Dispatcher::FilterChain');
10 my $c = 0;
12 my $chain = MojoX::Dispatcher::FilterChain->new();
14 $chain->add(Filter1->new());
15 $chain->add(Filter2->new());
16 $chain->process($c);
20 package Filter1;
21 use base 'MojoX::FilterChain::Base';
22 use MojoX::FilterChain::Constants;
24 sub run {
25     return NEXT;
29 package Filter2;
30 use base 'MojoX::FilterChain::Base';
31 use MojoX::FilterChain::Constants;
33 sub run {
34     return LAST;