r5409 - in /packages/libtest-www-mechanize-perl/branches/upstream/current: ./ t/

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Tue May 15 12:49:35 UTC 2007


Author: eloy
Date: Tue May 15 12:49:34 2007
New Revision: 5409

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5409
Log:
[svn-upgrade] Integrating new upstream version, libtest-www-mechanize-perl (1.14)

Modified:
    packages/libtest-www-mechanize-perl/branches/upstream/current/Changes
    packages/libtest-www-mechanize-perl/branches/upstream/current/META.yml
    packages/libtest-www-mechanize-perl/branches/upstream/current/Makefile.PL
    packages/libtest-www-mechanize-perl/branches/upstream/current/Mechanize.pm
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_contains.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_lacks.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/follow_link_ok.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/followable_links.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/get_ok.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/has_tag.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_content.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_status.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/links_ok.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_content.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_ok.t
    packages/libtest-www-mechanize-perl/branches/upstream/current/t/stuff_inputs.t

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/Changes?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/Changes (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/Changes Tue May 15 12:49:34 2007
@@ -1,9 +1,37 @@
 Revision history for Test-WWW-Mechanize
+
+1.14    Fri May 11 16:22:02 CDT 2007
+
+        [FIXES]
+        * Fixes test failures.  Thanks to Mark Blackman for RT #26602:
+
+            The module tests currently spawn a server (based on
+            HTTP::Server::Simple::CGI) which is killed when a __DIE__
+            signal is received, normally only when the invoking
+            perl dies. However, as perlvar makes clear, the __DIE__
+            signal is received when eval blocks die as well. The
+            new version (1.22) of WWW::Mechanize now calles
+            HTTP::Message::decoded_content which calls Encode.pm
+            which has a eval block that require's Encode::ConfigLocal
+            which is usually not present, so the eval dies and the
+            HTTP server is killed as soon as the $mech object tries
+            to do a 'get'. It's simple to use a system variable,
+            $^S to find out if the __DIE__ signal is being called
+            for an eval so we ignore that case with the patch
+            attached.
+
+        * The stuff_inputs() function now actually works.
+
+        [DOCUMENTATION]
+        * Made the synopsis show that T:W:M doesn't take the tests=>$x
+          like other Test::* modules.  It'd be nice if it did, though.
+
 
 1.12    Thu Jul  6 23:47:59 CDT 2006
         [ENHANCEMENTS]
         * Added followable_links() method to return only those links
           that your mech can actually follow.
+
 
 1.10    Sun Jun 18 22:58:41 CDT 2006
         [FIXES]

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/META.yml?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/META.yml (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/META.yml Tue May 15 12:49:34 2007
@@ -1,16 +1,19 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Test-WWW-Mechanize
-version:      1.12
-version_from: Mechanize.pm
-installdirs:  site
-requires:
+--- #YAML:1.0
+name:                Test-WWW-Mechanize
+version:             1.14
+abstract:            Testing-specific WWW::Mechanize subclass
+license:             ~
+generated_by:        ExtUtils::MakeMaker version 6.32
+distribution_type:   module
+requires:     
     Carp::Assert::More:            0
     HTTP::Server::Simple:          0.07
     Test::LongString:              0.07
     Test::More:                    0
     URI::file:                     0
-    WWW::Mechanize:                1.00
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+    WWW::Mechanize:                1.24
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2
+author:
+    - Andy Lester <andy at petdance.com>

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/Makefile.PL?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/Makefile.PL (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/Makefile.PL Tue May 15 12:49:34 2007
@@ -12,10 +12,20 @@
         'Test::More'        => 0,
         'Test::LongString'  => '0.07',
         'URI::file'         => 0,
-        'WWW::Mechanize'    => '1.00',
+        'WWW::Mechanize'    => '1.24',
         'Carp::Assert::More' => 0,
         'HTTP::Server::Simple' => '0.07',
     },
     dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
     clean               => { FILES => 'Test-WWW-Mechanize-*' },
 );
+
+sub MY::postamble {
+    return <<'MAKE_FRAG';
+.PHONY: critic
+
+critic:
+	perlcritic -1 -q -profile perlcriticrc bin/ lib/ t/
+
+MAKE_FRAG
+}

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/Mechanize.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/Mechanize.pm?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/Mechanize.pm (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/Mechanize.pm Tue May 15 12:49:34 2007
@@ -6,17 +6,21 @@
 
 =head1 VERSION
 
-Version 1.12
-
-=cut
-
-our $VERSION = '1.12';
+Version 1.14
+
+=cut
+
+our $VERSION = '1.14';
 
 =head1 SYNOPSIS
 
 Test::WWW::Mechanize is a subclass of L<WWW::Mechanize> that incorporates
 features for web application testing.  For example:
 
+    use Test::More tests => 5;
+    use Test::WWW::Mechanize;
+
+    my $mech = Test::WWW::Mechanize->new;
     $mech->get_ok( $page );
     $mech->base_is( 'http://petdance.com/', 'Proper <BASE HREF>' );
     $mech->title_is( "Invoice Status", "Make sure we're on the invoice page" );
@@ -25,6 +29,10 @@
 
 This is equivalent to:
 
+    use Test::More tests => 5;
+    use WWW::Mechanize;
+
+    my $mech = WWW::Mechanize->new;
     $mech->get( $page );
     ok( $mech->success );
     is( $mech->base, 'http://petdance.com', 'Proper <BASE HREF>' );
@@ -39,9 +47,9 @@
 use warnings;
 use strict;
 
-use WWW::Mechanize;
-use Test::LongString 0.07;
-use Test::Builder;
+use WWW::Mechanize ();
+use Test::LongString;
+use Test::Builder ();
 use Carp::Assert::More;
 
 use base 'WWW::Mechanize';
@@ -449,7 +457,7 @@
 
 =head2 $mech->links_ok( $links [, $desc ] )
 
-Check the current page for specified links and test for HTTP status
+Follow specified links on the current page and test for HTTP status
 200.  The links may be specified as a reference to an array containing
 L<WWW::Mechanize::Link> objects, an array of URLs, or a scalar URL
 name.
@@ -481,7 +489,7 @@
 
 =head2 $mech->link_status_is( $links, $status [, $desc ] )
 
-Check the current page for specified links and test for HTTP status
+Follow specified links on the current page and test for HTTP status
 passed.  The links may be specified as a reference to an array
 containing L<WWW::Mechanize::Link> objects, an array of URLs, or a
 scalar URL name.
@@ -510,7 +518,7 @@
 
 =head2 $mech->link_status_isnt( $links, $status [, $desc ] )
 
-Check the current page for specified links and test for HTTP status
+Follow specified links on the current page and test for HTTP status
 passed.  The links may be specified as a reference to an array
 containing L<WWW::Mechanize::Link> objects, an array of URLs, or a
 scalar URL name.
@@ -540,10 +548,10 @@
 
 =head2 $mech->link_content_like( $links, $regex [, $desc ] )
 
-Check the current page for specified links and test the content of
-each against I<$regex>.  The links may be specified as a reference to
-an array containing L<WWW::Mechanize::Link> objects, an array of URLs,
-or a scalar URL name.
+Follow specified links on the current page and test the resulting
+content of each against I<$regex>.  The links may be specified as a
+reference to an array containing L<WWW::Mechanize::Link> objects, an
+array of URLs, or a scalar URL name.
 
     my @links = $mech->followable_links();
     $mech->link_content_like( \@links, qr/Restricted/,
@@ -576,10 +584,10 @@
 
 =head2 $mech->link_content_unlike( $links, $regex [, $desc ] )
 
-Check the current page for specified links and test the content of each
-does not match I<$regex>.  The links may be specified as a reference to
-an array containing L<WWW::Mechanize::Link> objects, an array of URLs,
-or a scalar URL name.
+Follow specified links on the current page and test that the resulting
+content of each does not match I<$regex>.  The links may be specified as a
+reference to an array containing L<WWW::Mechanize::Link> objects, an array
+of URLs, or a scalar URL name.
 
     my @links = $mech->followable_links();
     $mech->link_content_unlike( \@links, qr/Restricted/,
@@ -693,7 +701,7 @@
     return @urls;
 }
 
-=head2 follow_link_ok( \%parms [, $comment] )
+=head2 $mech->follow_link_ok( \%parms [, $comment] )
 
 Makes a C<follow_link()> call and executes tests on the results.
 The link must be found, and then followed successfully.  Otherwise,
@@ -703,7 +711,7 @@
 Note that the parms to C<follow_link()> are a hash whereas the parms to
 this function are a hashref.  You have to call this function like:
 
-    $agent->follow_link_ok( {n=>3}, "looking for 3rd link" );
+    $mech->follow_link_ok( {n=>3}, "looking for 3rd link" );
 
 As with other test functions, C<$comment> is optional.  If it is supplied
 then it will display when running the test harness in verbose mode.
@@ -742,7 +750,7 @@
     return $ok;
 }
 
-=head2 $agent->stuff_inputs( [\%options] )
+=head2 $mech->stuff_inputs( [\%options] )
 
 Finds all free-text input fields (text, textarea, and password) in the
 current form and fills them to their maximum length in hopes of finding
@@ -827,8 +835,7 @@
         }
     }
 
-
-    my @inputs = $self->grep_inputs( { type => qr/^(text|textarea|password)$/ } );
+    my @inputs = $self->find_all_inputs( type => qr/^(text|textarea|password)$/ );
 
     foreach my $field ( @inputs ) {
         next if $field->readonly();
@@ -927,6 +934,8 @@
 =head1 ACKNOWLEDGEMENTS
 
 Thanks to
+Michael Schwern,
+Mark Blackman,
 Mike O'Regan,
 Shawn Sorichetti,
 Chris Dolan,
@@ -936,7 +945,7 @@
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2004-2005 Andy Lester, all rights reserved.
+Copyright 2004-2007 Andy Lester, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_contains.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_contains.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_contains.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_contains.t Tue May 15 12:49:34 2007
@@ -17,7 +17,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_lacks.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_lacks.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_lacks.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/content_lacks.t Tue May 15 12:49:34 2007
@@ -17,7 +17,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/follow_link_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/follow_link_ok.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/follow_link_ok.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/follow_link_ok.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 FOLLOW_GOOD_LINK: {

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/followable_links.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/followable_links.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/followable_links.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/followable_links.t Tue May 15 12:49:34 2007
@@ -19,7 +19,7 @@
 my $pid = $server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech = Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/get_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/get_ok.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/get_ok.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/get_ok.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/has_tag.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/has_tag.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/has_tag.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/has_tag.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_content.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_content.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_content.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_content.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_status.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_status.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_status.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/link_status.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/links_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/links_ok.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/links_ok.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/links_ok.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_content.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_content.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_content.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_content.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_ok.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_ok.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/page_links_ok.t Tue May 15 12:49:34 2007
@@ -18,7 +18,7 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();

Modified: packages/libtest-www-mechanize-perl/branches/upstream/current/t/stuff_inputs.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libtest-www-mechanize-perl/branches/upstream/current/t/stuff_inputs.t?rev=5409&op=diff
==============================================================================
--- packages/libtest-www-mechanize-perl/branches/upstream/current/t/stuff_inputs.t (original)
+++ packages/libtest-www-mechanize-perl/branches/upstream/current/t/stuff_inputs.t Tue May 15 12:49:34 2007
@@ -18,14 +18,14 @@
 my $pid=$server->background;
 ok($pid,'HTTP Server started') or die "Can't start the server";
 
-sub cleanup { kill(9,$pid) };
+sub cleanup { kill(9,$pid) if !$^S };
 $SIG{__DIE__}=\&cleanup;
 
 my $mech=Test::WWW::Mechanize->new();
 isa_ok( $mech, 'Test::WWW::Mechanize' );
 
 $mech->get('http://localhost:'.PORT.'/form.html');
-#$mech->stuff_inputs();
+$mech->stuff_inputs();
 
 
 cleanup();




More information about the Pkg-perl-cvs-commits mailing list