Skip to content

Commit

Permalink
test root
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 8, 2012
1 parent c2a0d34 commit 1dcb1b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion t/mojolicious/routes.t
Expand Up @@ -193,6 +193,7 @@ is $second->render('', {}), '/target/second', 'right result';
my $c = Mojolicious::Controller->new;
my $m = Mojolicious::Routes::Match->new(GET => '/clean');
$m->match($r, $c);
is $m->root, $r, 'right root';
is $m->endpoint->name, 'very_clean', 'right name';
is $m->stack->[0]{clean}, 1, 'right value';
is $m->stack->[0]{something}, undef, 'no value';
Expand All @@ -208,10 +209,10 @@ is @{$m->stack}, 1, 'right number of elements';
# No match
$m = Mojolicious::Routes::Match->new(GET => '/does_not_exist');
$m->match($r, $c);
is $m->root, $r, 'right root';
is $m->endpoint, undef, 'no endpoint';
is_deeply $m->stack, [], 'empty stack';
is_deeply $m->captures, {}, 'empty captures';
is $m->path_for, undef, 'no path';

# Introspect
is $r->find('very_clean')->to_string, '/clean', 'right pattern';
Expand Down

0 comments on commit 1dcb1b0

Please sign in to comment.