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

sartak at bestpractical.com sartak at bestpractical.com
Tue Nov 4 17:35:52 EST 2008


Author: sartak
Date: Tue Nov  4 17:35:47 2008
New Revision: 16667

Added:
   Path-Dispatcher/trunk/t/901-return-values.t
Modified:
   Path-Dispatcher/trunk/   (props changed)

Log:
 r74956 at onn:  sartak | 2008-11-03 22:20:05 -0500
 Test that the matcher returning the wrong thing throws an error. This will probably never come up in practice but it is a limitation for now


Added: Path-Dispatcher/trunk/t/901-return-values.t
==============================================================================
--- (empty file)
+++ Path-Dispatcher/trunk/t/901-return-values.t	Tue Nov  4 17:35:47 2008
@@ -0,0 +1,19 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+use Test::Exception;
+use Path::Dispatcher;
+
+my $dispatcher = Path::Dispatcher->new(
+    rules => [
+        Path::Dispatcher::Rule::CodeRef->new(
+            matcher => sub { [{ cant_handle_complex_list_of_results => 1 }] },
+        ),
+    ],
+);
+
+throws_ok {
+    $dispatcher->dispatch('foo');
+} qr/Invalid result 'HASH\(\w+\)', results must be plain strings/;
+



More information about the Bps-public-commit mailing list