AnyEvent-HTTPD-Router

 view release on metacpan or  search on metacpan

t/06_allowed_methods.t  view on Meta::CPAN

#!perl
use lib 't/lib';
use common::sense;

use Test::More;
use AnyEvent::HTTPD::Router;

my $httpd = AnyEvent::HTTPD::Router->new();

is_deeply $httpd->allowed_methods, [qw(GET HEAD POST)], 'initial default routes';

$httpd->{allowed_methods} = [];

is_deeply $httpd->allowed_methods, [], 'removed all methods';

$httpd->reg_routes( ':custom' => '/yada' => sub {} );

is_deeply $httpd->allowed_methods, [qw(GET POST)], 'custom methods use GET or POST';

$httpd->reg_routes( PUT => '/yada' => sub {} );

is_deeply $httpd->allowed_methods, [qw(GET POST PUT)], 'PUT was added';

done_testing;



( run in 0.727 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )