The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More tests => 6;

use Dancer;
use Dancer::Test;

my %method = (
    get     => 'GET',
    post    => 'POST',
    del     => 'DELETE',
    patch   => 'PATCH',
    put     => 'PUT',
    options => 'OPTIONS',
);

while (my ($method, $http) = each %method) {
    eval "$method '/' => sub { '$method' }";
    response_content_is [$http => '/'], $method, $method;
}