[Jifty-commit] r4159 - in Test-WWW-Declare: lib/Test/WWW t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Sep 26 15:38:00 EDT 2007


Author: sartak
Date: Wed Sep 26 15:37:50 2007
New Revision: 4159

Modified:
   Test-WWW-Declare/   (props changed)
   Test-WWW-Declare/META.yml
   Test-WWW-Declare/lib/Test/WWW/Declare.pm
   Test-WWW-Declare/t/01-basic.t

Log:
 r43124 at onn:  sartak | 2007-09-26 15:37:40 -0400
 Bump to 0.01_01, it's probably OK to start CPANning
 Add "url/uri should match" etc


Modified: Test-WWW-Declare/META.yml
==============================================================================
--- Test-WWW-Declare/META.yml	(original)
+++ Test-WWW-Declare/META.yml	Wed Sep 26 15:37:50 2007
@@ -17,4 +17,4 @@
   Test::Builder: 0
   Test::More: 0
   Test::WWW::Mechanize: 0
-version: 0.00
+version: 0.01_01

Modified: Test-WWW-Declare/lib/Test/WWW/Declare.pm
==============================================================================
--- Test-WWW-Declare/lib/Test/WWW/Declare.pm	(original)
+++ Test-WWW-Declare/lib/Test/WWW/Declare.pm	Wed Sep 26 15:37:50 2007
@@ -5,12 +5,12 @@
 use Test::WWW::Mechanize;
 use Test::Builder;
 
-our $VERSION  = '0.00';
+our $VERSION  = '0.01_01';
 
-our @EXPORT = qw(flow run get session check mech match follow link content
+our @EXPORT = qw(flow run get session check mech match follow_link content
                  should shouldnt click href button fill form SKIP _twd_dummy
                  title equal caselessly contain matches equals contains
-                 never always lack lacks);
+                 never always lack lacks url uri);
 our $BUILDER = Test::Builder->new();
 our $WWW_MECHANIZE;
 our $IN_FLOW;
@@ -124,6 +124,8 @@
 
 =head3 title
 
+=head3 url
+
 =head2 VERBS
 
 =head3 should(nt) (caselessly) match REGEX
@@ -279,6 +281,12 @@
     _magic_match({got => $title, name => "Title '$title'", %{shift @_}});
 }
 
+sub url ($) {
+    my $url = mech()->uri;
+    _magic_match({got => $url, name => "URL '$url'", %{shift @_}});
+}
+*uri = \&url;
+
 # yes, there's a little too much logic in here. that's why it's magic
 sub _magic_match {
     my $orig = shift @_;

Modified: Test-WWW-Declare/t/01-basic.t
==============================================================================
--- Test-WWW-Declare/t/01-basic.t	(original)
+++ Test-WWW-Declare/t/01-basic.t	Wed Sep 26 15:37:50 2007
@@ -11,6 +11,7 @@
                 content should match qr{This is an index};
                 click href qr{good};
                 content should match qr{This is a good page}i;
+                uri should contain 'good';
             };
         };
     }


More information about the Jifty-commit mailing list