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

sartak at bestpractical.com sartak at bestpractical.com
Wed Jan 28 01:38:02 EST 2009


Author: sartak
Date: Wed Jan 28 01:38:02 2009
New Revision: 17950

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/t/106-metadata.t

Log:
 r79170 at onn:  sartak | 2009-01-28 01:37:57 -0500
 (Failing) tests for metadata deep data structures


Modified: Path-Dispatcher/trunk/t/106-metadata.t
==============================================================================
--- Path-Dispatcher/trunk/t/106-metadata.t	(original)
+++ Path-Dispatcher/trunk/t/106-metadata.t	Wed Jan 28 01:38:02 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 my @calls;
 
@@ -18,9 +18,35 @@
     path     => "/REST/Ticket/1.yml",
     metadata => {
         method => "GET",
+        query_parameters => {
+            owner => 'Sartak',
+            status => 'closed',
+        },
     },
 );
 
 MyApp::Dispatcher->run($path);
 is_deeply([splice @calls], ["method: GET, path: /REST/Ticket/1.yml"]);
 
+do {
+    package MyApp::Other::Dispatcher;
+    use Path::Dispatcher::Declarative -base;
+
+    on {
+        query_parameters => {
+            owner => qr/^\w+$/,
+        },
+    } => sub {
+        push @calls, "query_parameters/owner/regex";
+    };
+};
+
+TODO: {
+    local $TODO = "metadata can't be a deep data structure";
+
+    eval {
+        MyApp::Other::Dispatcher->run($path);
+    };
+    is_deeply([splice @calls], ["query_parameters/owner/regex"]);
+};
+



More information about the Bps-public-commit mailing list