[Bps-public-commit] r17419 - in Path-Dispatcher/trunk: t
sartak at bestpractical.com
sartak at bestpractical.com
Mon Dec 29 21:09:27 EST 2008
Author: sartak
Date: Mon Dec 29 21:09:27 2008
New Revision: 17419
Added:
Path-Dispatcher/trunk/t/200-under-next_rule.t
Modified:
Path-Dispatcher/trunk/ (props changed)
Log:
r78054 at onn: sartak | 2008-12-29 21:09:24 -0500
TODO tests for under dwimming wrt path
Added: Path-Dispatcher/trunk/t/200-under-next_rule.t
==============================================================================
--- (empty file)
+++ Path-Dispatcher/trunk/t/200-under-next_rule.t Mon Dec 29 21:09:27 2008
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+
+my @calls;
+
+do {
+ package MyApp::Dispatcher;
+ use Path::Dispatcher::Declarative -base;
+
+ under first => sub {
+ on qr/./ => sub {
+ push @calls, "[$_] first -> regex";
+ next_rule;
+ };
+
+ on second => sub {
+ push @calls, "[$_] first -> string, via next_rule";
+ };
+ };
+};
+
+TODO: {
+ local $TODO = "under doesn't pass its matched fragment as part of the path";
+ MyApp::Dispatcher->run("first second");
+ is_deeply([splice @calls], [
+ "[first second] first -> regex",
+ "[first second] first -> string, via next_rule",
+ ]);
+}
+
More information about the Bps-public-commit
mailing list