t/dsl/route_retvals.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Dancer2; |
| 4 | use Test::More (); |
| 5 | |
| 6 | my @routes = get '/' => sub {1}; |
| 7 | Test::More::is( scalar @routes, 2, 'Two routes available' ); |
| 8 | foreach my $route (@routes) { |
| 9 | Test::More::isa_ok( $route, 'Dancer2::Core::Route' ); |
| 10 | } |
| 11 | |
| 12 | Test::More::is( $routes[0]->method, 'get', 'Created GET route' ); |
| 13 | Test::More::is( $routes[1]->method, 'head', 'Created HEAD route too' ); |
| 14 | |
| 15 | Test::More::done_testing; |