[Bps-public-commit] r16672 - in Path-Dispatcher/trunk: lib/Path/Dispatcher/Rule t

sartak at bestpractical.com sartak at bestpractical.com
Tue Nov 4 17:36:29 EST 2008


Author: sartak
Date: Tue Nov  4 17:36:24 2008
New Revision: 16672

Added:
   Path-Dispatcher/trunk/t/903-weird-token.t
Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm

Log:
 r74961 at onn:  sartak | 2008-11-03 22:34:48 -0500
 Argh, fix the type constraint check for tokens


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	Tue Nov  4 17:36:24 2008
@@ -30,7 +30,6 @@
 has tokens => (
     is         => 'rw',
     isa        => 'Path::Dispatcher::Tokens',
-    isa        => 'ArrayRef',
     auto_deref => 1,
     required   => 1,
 );

Added: Path-Dispatcher/trunk/t/903-weird-token.t
==============================================================================
--- (empty file)
+++ Path-Dispatcher/trunk/t/903-weird-token.t	Tue Nov  4 17:36:24 2008
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 1;
+use Path::Dispatcher;
+use Test::Exception;
+
+throws_ok {
+    Path::Dispatcher::Rule::Tokens->new(
+        tokens => [ 'foo', { bar => 1 }, 'baz' ],
+    )
+} qr/^Attribute \(tokens\) does not pass the type constraint because: Validation failed for 'Path::Dispatcher::Tokens' failed with value ARRAY\(\w+\)/;
+



More information about the Bps-public-commit mailing list