[Bps-public-commit] r16365 - in Path-Dispatcher/trunk: t

sartak at bestpractical.com sartak at bestpractical.com
Sun Oct 19 06:22:57 EDT 2008


Author: sartak
Date: Sun Oct 19 06:22:57 2008
New Revision: 16365

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/t/012-under.t

Log:
 r74133 at onn:  sartak | 2008-10-19 06:22:54 -0400
 More substantial tests for under


Modified: Path-Dispatcher/trunk/t/012-under.t
==============================================================================
--- Path-Dispatcher/trunk/t/012-under.t	(original)
+++ Path-Dispatcher/trunk/t/012-under.t	Sun Oct 19 06:22:57 2008
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 9;
+use Test::More tests => 4;
 use Path::Dispatcher;
 
 my @calls;
@@ -19,6 +19,7 @@
 my $update = Path::Dispatcher::Rule::Tokens->new(
     tokens => ['update'],
     block  => sub { push @calls, "ticket update" },
+    prefix => 1,
 );
 
 my $under = Path::Dispatcher::Rule::Under->new(
@@ -29,3 +30,12 @@
 my ($ticket_create) = $under->match("ticket create");
 ok($ticket_create, "matched 'ticket create'");
 
+my ($fail) = $under->match("ticket create foo");
+ok(!$fail, "did not match 'ticket create' because it's not a prefix");
+
+my ($ticket_update) = $under->match("ticket update");
+ok($ticket_update, "matched 'ticket update'");
+
+my ($ticket_update_foo) = $under->match("ticket update foo");
+ok($ticket_update_foo, "matched 'ticket update foo' because it is a prefix");
+



More information about the Bps-public-commit mailing list