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

sartak at bestpractical.com sartak at bestpractical.com
Tue Nov 18 19:21:19 EST 2008


Author: sartak
Date: Tue Nov 18 19:21:18 2008
New Revision: 16911

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/t/002-rule.t
   Path-Dispatcher/trunk/t/012-under.t
   Path-Dispatcher/trunk/t/013-tokens.t
   Path-Dispatcher/trunk/t/014-tokens-prefix.t
   Path-Dispatcher/trunk/t/015-regex-prefix.t
   Path-Dispatcher/trunk/t/902-coderef.t
   Path-Dispatcher/trunk/t/903-weird-token.t

Log:
 r75772 at onn:  sartak | 2008-11-18 19:21:13 -0500
 Test fixes


Modified: Path-Dispatcher/trunk/t/002-rule.t
==============================================================================
--- Path-Dispatcher/trunk/t/002-rule.t	(original)
+++ Path-Dispatcher/trunk/t/002-rule.t	Tue Nov 18 19:21:18 2008
@@ -16,8 +16,8 @@
     },
 );
 
-isa_ok($rule->match('foobar'), 'Path::Dispatcher::Match');
-is_deeply($rule->match('foobar')->result, ['fo', 'ob']);
+isa_ok($rule->match(Path::Dispatcher::Path->new('foobar')), 'Path::Dispatcher::Match');
+is_deeply($rule->match(Path::Dispatcher::Path->new('foobar'))->result, ['fo', 'ob']);
 is_deeply([splice @calls], [], "block not called on match");
 
 $rule->run;

Modified: Path-Dispatcher/trunk/t/012-under.t
==============================================================================
--- Path-Dispatcher/trunk/t/012-under.t	(original)
+++ Path-Dispatcher/trunk/t/012-under.t	Tue Nov 18 19:21:18 2008
@@ -53,7 +53,7 @@
     my $data = $tests{$path};
     my $name = $data->{name} || $path;
 
-    my $match = $under->match($path);
+    my $match = $under->match(Path::Dispatcher::Path->new($path));
     $match = !$match if $data->{fail};
     ok($match, $name);
 }
@@ -68,7 +68,7 @@
     my $data = $tests{$path};
     my $name = $data->{name} || $path;
 
-    my $match = $under->match($path);
+    my $match = $under->match(Path::Dispatcher::Path->new($path));
     $match = !$match if $data->{fail} && !$data->{catchall};
     ok($match, $name);
 }

Modified: Path-Dispatcher/trunk/t/013-tokens.t
==============================================================================
--- Path-Dispatcher/trunk/t/013-tokens.t	(original)
+++ Path-Dispatcher/trunk/t/013-tokens.t	Tue Nov 18 19:21:18 2008
@@ -69,6 +69,6 @@
     case_sensitive => 0,
 );
 
-my $match = $rule->match('Path::Dispatcher::Rule::Tokens');
+my $match = $rule->match(Path::Dispatcher::Path->new('Path::Dispatcher::Rule::Tokens'));
 is($match->leftover, 'Rule::Tokens');
 

Modified: Path-Dispatcher/trunk/t/014-tokens-prefix.t
==============================================================================
--- Path-Dispatcher/trunk/t/014-tokens-prefix.t	(original)
+++ Path-Dispatcher/trunk/t/014-tokens-prefix.t	Tue Nov 18 19:21:18 2008
@@ -12,10 +12,10 @@
     prefix => 1,
 );
 
-ok(!$rule->match('foo'), "prefix means the rule matches a prefix of the path, not the other way around");
-ok($rule->match('foo bar'), "prefix matches the full path");
+ok(!$rule->match(Path::Dispatcher::Path->new('foo')), "prefix means the rule matches a prefix of the path, not the other way around");
+ok($rule->match(Path::Dispatcher::Path->new('foo bar')), "prefix matches the full path");
 
-my $match = $rule->match('foo bar baz');
+my $match = $rule->match(Path::Dispatcher::Path->new('foo bar baz'));
 ok($match, "prefix matches a prefix of the path");
 is_deeply($match->result, ["foo", "bar"]);
 is($match->leftover, "baz");

Modified: Path-Dispatcher/trunk/t/015-regex-prefix.t
==============================================================================
--- Path-Dispatcher/trunk/t/015-regex-prefix.t	(original)
+++ Path-Dispatcher/trunk/t/015-regex-prefix.t	Tue Nov 18 19:21:18 2008
@@ -12,10 +12,10 @@
     prefix => 1,
 );
 
-ok(!$rule->match('foo'), "prefix means the rule matches a prefix of the path, not the other way around");
-ok($rule->match('foo bar'), "prefix matches the full path");
-ok($rule->match('foo bar baz'), "prefix matches a prefix of the path");
-my $match = $rule->match('foobar:baz');
+ok(!$rule->match(Path::Dispatcher::Path->new('foo')), "prefix means the rule matches a prefix of the path, not the other way around");
+ok($rule->match(Path::Dispatcher::Path->new('foo bar')), "prefix matches the full path");
+ok($rule->match(Path::Dispatcher::Path->new('foo bar baz')), "prefix matches a prefix of the path");
+my $match = $rule->match(Path::Dispatcher::Path->new('foobar:baz'));
 
 ok($match, "matched foobar:baz");
 

Modified: Path-Dispatcher/trunk/t/902-coderef.t
==============================================================================
--- Path-Dispatcher/trunk/t/902-coderef.t	(original)
+++ Path-Dispatcher/trunk/t/902-coderef.t	Tue Nov 18 19:21:18 2008
@@ -13,7 +13,7 @@
     $rule->run;
 } qr/^No codeblock to run/;
 
-my $match = $rule->match('bus train');
+my $match = $rule->match(Path::Dispatcher::Path->new('bus train'));
 ok($match, "matched the tokens");
 
 throws_ok {

Modified: Path-Dispatcher/trunk/t/903-weird-token.t
==============================================================================
--- Path-Dispatcher/trunk/t/903-weird-token.t	(original)
+++ Path-Dispatcher/trunk/t/903-weird-token.t	Tue Nov 18 19:21:18 2008
@@ -18,5 +18,5 @@
 push @{ $rule->{tokens} }, { weird_token => 1 };
 
 throws_ok {
-    $rule->match("mezzanine");
+    $rule->match(Path::Dispatcher::Path->new("mezzanine"));
 } qr/^Unexpected token 'HASH\(\w+\)'/;



More information about the Bps-public-commit mailing list