[Bps-public-commit] r16670 - in Path-Dispatcher/trunk: t
sartak at bestpractical.com
sartak at bestpractical.com
Tue Nov 4 17:36:03 EST 2008
Author: sartak
Date: Tue Nov 4 17:36:02 2008
New Revision: 16670
Added:
Path-Dispatcher/trunk/t/902-coderef.t
Modified:
Path-Dispatcher/trunk/ (props changed)
Log:
r74959 at onn: sartak | 2008-11-03 22:23:57 -0500
Test that trying to run a rule that lacks a coderef is an error
Added: Path-Dispatcher/trunk/t/902-coderef.t
==============================================================================
--- (empty file)
+++ Path-Dispatcher/trunk/t/902-coderef.t Tue Nov 4 17:36:02 2008
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 3;
+use Test::Exception;
+use Path::Dispatcher::Rule::Tokens;
+
+my $rule = Path::Dispatcher::Rule::Tokens->new(
+ tokens => ['bus', 'train'],
+);
+
+throws_ok {
+ $rule->run;
+} qr/^No codeblock to run/;
+
+my $match = $rule->match('bus train');
+ok($match, "matched the tokens");
+
+throws_ok {
+ $match->run;
+} qr/^No codeblock to run/;
+
More information about the Bps-public-commit
mailing list