[Bps-public-commit] r16852 - in Path-Dispatcher/trunk: lib/Path/Dispatcher t
sartak at bestpractical.com
sartak at bestpractical.com
Sat Nov 15 21:01:34 EST 2008
Author: sartak
Date: Sat Nov 15 21:01:34 2008
New Revision: 16852
Modified:
Path-Dispatcher/trunk/ (props changed)
Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
Path-Dispatcher/trunk/t/105-always.t
Log:
r75559 at onn: sartak | 2008-11-15 21:01:29 -0500
Make "on ''" match only the empty path
Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm (original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm Sat Nov 15 21:01:34 2008
@@ -161,7 +161,7 @@
},
empty => sub {
my ($self, $undef, $block) = @_;
- Path::Dispatcher::Rule::Always->new(
+ Path::Dispatcher::Rule::Empty->new(
$block ? (block => $block) : (),
),
},
Modified: Path-Dispatcher/trunk/t/105-always.t
==============================================================================
--- Path-Dispatcher/trunk/t/105-always.t (original)
+++ Path-Dispatcher/trunk/t/105-always.t Sat Nov 15 21:01:34 2008
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
my @calls;
@@ -15,5 +15,8 @@
};
MyApp::Dispatcher->run("foo");
-is_deeply([splice @calls], ["empty: foo"]);
+is_deeply([splice @calls], []);
+
+MyApp::Dispatcher->run("");
+is_deeply([splice @calls], ["empty: "]);
More information about the Bps-public-commit
mailing list