[Jifty-commit] jifty branch, master, updated. jifty-1.10228-7-g678f9ac

Jifty commits jifty-commit at lists.jifty.org
Thu Apr 14 14:11:03 EDT 2011

The branch, master has been updated
       via  678f9ac35598ff9f30c3c0c30f5c96e1edcca704 (commit)
      from  bc48b4ff155c6b936a15e4be28006d706a2774bd (commit)

Summary of changes:
 lib/Jifty/Test/WWW/Mechanize.pm |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 678f9ac35598ff9f30c3c0c30f5c96e1edcca704
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Apr 14 14:09:52 2011 -0400

    Pull in improvements from Jifty::Client::field_error_text
        If we were using Moose the Jifty-specific features like this could
        be a role that we apply to WWW::Mechanize for Jifty::Client and
        Test::WWW::Mechanize for Jifty::Test::WWW::Mechanize, then we
        wouldn't have such duplication.

diff --git a/lib/Jifty/Test/WWW/Mechanize.pm b/lib/Jifty/Test/WWW/Mechanize.pm
index 23cc76e..c2b1a7a 100644
--- a/lib/Jifty/Test/WWW/Mechanize.pm
+++ b/lib/Jifty/Test/WWW/Mechanize.pm
@@ -341,7 +341,7 @@ sub fragment_request {
 Finds the error span on the current page for the name FIELD in the
 action MONIKER, and returns the text (tags stripped) from it.  (If the
-field can't be found.
+field can't be found, return undef).
@@ -350,10 +350,11 @@ sub field_error_text {
     my $moniker = shift;
     my $field = shift;
+    # Setup the XPath processor and the ID we're looking for
     my $xp = XML::XPath->new( xml => $self->content );
     my $id = "errors-J:A:F-$field-$moniker";
+    # Search for the span containing that error
     my $nodeset = $xp->findnodes(qq{//span[\@id = "$id"]});
     return unless $nodeset->size == 1;


More information about the Jifty-commit mailing list