r55560 - in /branches/upstream/libtest-www-mechanize-perl/current: Changes META.yml Makefile.PL Mechanize.pm t/content_contains.t t/content_lacks.t t/html/goodlinks.html t/put_ok.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Apr 6 21:08:12 UTC 2010
Author: jawnsy-guest
Date: Tue Apr 6 21:07:41 2010
New Revision: 55560
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55560
Log:
[svn-upgrade] Integrating new upstream version, libtest-www-mechanize-perl (1.26)
Modified:
branches/upstream/libtest-www-mechanize-perl/current/Changes
branches/upstream/libtest-www-mechanize-perl/current/META.yml
branches/upstream/libtest-www-mechanize-perl/current/Makefile.PL
branches/upstream/libtest-www-mechanize-perl/current/Mechanize.pm
branches/upstream/libtest-www-mechanize-perl/current/t/content_contains.t
branches/upstream/libtest-www-mechanize-perl/current/t/content_lacks.t
branches/upstream/libtest-www-mechanize-perl/current/t/html/goodlinks.html
branches/upstream/libtest-www-mechanize-perl/current/t/put_ok.t
Modified: branches/upstream/libtest-www-mechanize-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/Changes?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/Changes (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/Changes Tue Apr 6 21:07:41 2010
@@ -3,6 +3,25 @@
WWW::Mechanize and Test::WWW::Mechanize do not use rt.cpan.org for
bug tracking. They are now being tracked via Google Code at
http://code.google.com/p/www-mechanize/issues/list
+
+NEXT
+1.26 Mon Apr 5 00:54:46 CDT 2010
+------------------------------------
+[FIXED]
+Description of error in $mech->content_unlike() was wrong.
+
+Now requires Test::LongString 0.12.
+
+t/put_ok.t now passes, but with a handful of warnings. Help in figuring
+out why would be appreciated.
+
+[INTERNALS]
+Hoisted common code out of get_ok, post_ok, etc.
+
+[DOCUMENTATION]
+Updated copyright and licensing information.
+
+
1.24 Sat Jan 17 13:26:47 CST 2009
------------------------------------
@@ -95,7 +114,6 @@
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
Modified: branches/upstream/libtest-www-mechanize-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/META.yml?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/META.yml (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/META.yml Tue Apr 6 21:07:41 2010
@@ -1,21 +1,36 @@
--- #YAML:1.0
-name: Test-WWW-Mechanize
-version: 1.24
-abstract: Testing-specific WWW::Mechanize subclass
-license: ~
-author:
+name: Test-WWW-Mechanize
+version: 1.26
+abstract: Testing-specific WWW::Mechanize subclass
+author:
- Andy Lester <andy at petdance.com>
-generated_by: ExtUtils::MakeMaker version 6.44
-distribution_type: module
-requires:
- Carp::Assert::More: 0
- HTTP::Server::Simple: 0.35
- HTTP::Server::Simple::CGI: 0
- Test::Builder::Tester: 1.09
- Test::LongString: 0.07
- Test::More: 0
- URI::file: 0
- WWW::Mechanize: 1.24
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ Carp::Assert::More: 0
+ HTTP::Server::Simple: 0.35
+ HTTP::Server::Simple::CGI: 0
+ perl: 5.008
+ Test::Builder::Tester: 1.09
+ Test::LongString: 0.12
+ Test::More: 0
+ URI::file: 0
+ WWW::Mechanize: 1.24
+resources:
+ bugtracker: http://code.google.com/p/www-mechanize/issues/list
+ homepage: http://code.google.com/p/www-mechanize/
+ license: http://dev.perl.org/licenses/
+ MailingList: http://groups.google.com/group/www-mechanize-users
+ Repository: http://code.google.com/p/www-mechanize/source
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libtest-www-mechanize-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/Makefile.PL?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/Makefile.PL Tue Apr 6 21:07:41 2010
@@ -13,7 +13,7 @@
'HTTP::Server::Simple' => '0.35',
'HTTP::Server::Simple::CGI' => 0,
'Test::Builder::Tester' => '1.09',
- 'Test::LongString' => '0.07',
+ 'Test::LongString' => '0.12',
'Test::More' => 0,
'URI::file' => 0,
'WWW::Mechanize' => '1.24',
@@ -22,13 +22,21 @@
clean => { FILES => 'Test-WWW-Mechanize-*' },
};
-if ( $ExtUtils::MakeMaker::VERSION eq '6.36' ) {
- $parms->{EXTRA_META} = <<EOF;
-resources:
- homepage: http://code.google.com/p/www-mechanize/
- bugtracker: http://code.google.com/p/www-mechanize/issues/list
-EOF
- }
+if ( $ExtUtils::MakeMaker::VERSION ge '6.45_01' ) {
+ $parms->{META_MERGE} = {
+ resources => {
+ license => 'http://dev.perl.org/licenses/',
+ homepage => 'http://code.google.com/p/www-mechanize/',
+ bugtracker => 'http://code.google.com/p/www-mechanize/issues/list',
+ Repository => 'http://code.google.com/p/www-mechanize/source',
+ MailingList => 'http://groups.google.com/group/www-mechanize-users',
+ }
+ };
+ $parms->{LICENSE} = 'perl';
+}
+if ( $ExtUtils::MakeMaker::VERSION ge '6.47_02' ) {
+ $parms->{MIN_PERL_VERSION} = 5.008;
+}
WriteMakefile( %{$parms} );
Modified: branches/upstream/libtest-www-mechanize-perl/current/Mechanize.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/Mechanize.pm?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/Mechanize.pm (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/Mechanize.pm Tue Apr 6 21:07:41 2010
@@ -9,11 +9,11 @@
=head1 VERSION
-Version 1.24
-
-=cut
-
-our $VERSION = '1.24';
+Version 1.26
+
+=cut
+
+our $VERSION = '1.26';
=head1 SYNOPSIS
@@ -156,37 +156,11 @@
sub get_ok {
my $self = shift;
- my $url = shift;
-
- my $desc;
- my %opts;
-
- if ( @_ ) {
- my $flex = shift; # The flexible argument
-
- if ( !defined( $flex ) ) {
- $desc = shift;
- }
- elsif ( ref $flex eq 'HASH' ) {
- %opts = %{$flex};
- $desc = shift;
- }
- elsif ( ref $flex eq 'ARRAY' ) {
- %opts = @{$flex};
- $desc = shift;
- }
- else {
- $desc = $flex;
- }
- } # parms left
+
+ my ($url,$desc,%opts) = $self->_unpack_args( 'GET', @_ );
$self->get( $url, %opts );
my $ok = $self->success;
-
- if ( not defined $desc ) {
- $url = $url->url if ref($url) eq 'WWW::Mechanize::Link';
- $desc = "GET $url";
- }
$ok = $self->_maybe_lint( $ok, $desc );
@@ -230,37 +204,12 @@
sub head_ok {
my $self = shift;
- my $url = shift;
-
- my $desc;
- my %opts;
-
- if ( @_ ) {
- my $flex = shift; # The flexible argument
-
- if ( !defined( $flex ) ) {
- $desc = shift;
- }
- elsif ( ref $flex eq 'HASH' ) {
- %opts = %{$flex};
- $desc = shift;
- }
- elsif ( ref $flex eq 'ARRAY' ) {
- %opts = @{$flex};
- $desc = shift;
- }
- else {
- $desc = $flex;
- }
- } # parms left
+
+ my ($url,$desc,%opts) = $self->_unpack_args( 'HEAD', @_ );
$self->head( $url, %opts );
my $ok = $self->success;
- if ( not defined $desc ) {
- $url = $url->url if ref($url) eq 'WWW::Mechanize::Link';
- $desc = "HEAD $url";
- }
$Test->ok( $ok, $desc );
if ( !$ok ) {
$Test->diag( $self->status );
@@ -270,6 +219,7 @@
return $ok;
}
+
=head2 $mech->post_ok( $url, [ \%LWP_options ,] $desc )
A wrapper around WWW::Mechanize's post(), with similar options, except
@@ -283,34 +233,9 @@
sub post_ok {
my $self = shift;
- my $url = shift;
-
- my $desc;
- my %opts;
-
- if ( @_ ) {
- my $flex = shift; # The flexible argument
-
- if ( !defined( $flex ) ) {
- $desc = shift;
- }
- elsif ( ref $flex eq 'HASH' ) {
- %opts = %{$flex};
- $desc = shift;
- }
- elsif ( ref $flex eq 'ARRAY' ) {
- %opts = @{$flex};
- $desc = shift;
- }
- else {
- $desc = $flex;
- }
- } # parms left
-
- if ( not defined $desc ) {
- $url = $url->url if ref($url) eq 'WWW::Mechanize::Link';
- $desc = "POST $url";
- }
+
+ my ($url,$desc,%opts) = $self->_unpack_args( 'POST', @_ );
+
$self->post( $url, \%opts );
my $ok = $self->success;
$Test->ok( $ok, $desc );
@@ -335,35 +260,10 @@
sub put_ok {
my $self = shift;
- my $url = shift;
-
- my $desc;
- my %opts;
-
- if ( @_ ) {
- my $flex = shift; # The flexible argument
-
- if ( !defined( $flex ) ) {
- $desc = shift;
- }
- elsif ( ref $flex eq 'HASH' ) {
- %opts = %{$flex};
- $desc = shift;
- }
- elsif ( ref $flex eq 'ARRAY' ) {
- %opts = @{$flex};
- $desc = shift;
- }
- else {
- $desc = $flex;
- }
- } # parms left
-
- if ( not defined $desc ) {
- $url = $url->url if ref($url) eq 'WWW::Mechanize::Link';
- $desc = "PUT $url";
- }
+
+ my ($url,$desc,%opts) = $self->_unpack_args( 'PUT', @_ );
$self->put( $url, \%opts );
+
my $ok = $self->success;
$Test->ok( $ok, $desc );
if ( !$ok ) {
@@ -511,6 +411,44 @@
}
return $Test->ok( 1, $desc );
}
+
+
+sub _unpack_args {
+ my $self = shift;
+ my $method = shift;
+ my $url = shift;
+
+ my $desc;
+ my %opts;
+
+ if ( @_ ) {
+ my $flex = shift; # The flexible argument
+
+ if ( !defined( $flex ) ) {
+ $desc = shift;
+ }
+ elsif ( ref $flex eq 'HASH' ) {
+ %opts = %{$flex};
+ $desc = shift;
+ }
+ elsif ( ref $flex eq 'ARRAY' ) {
+ %opts = @{$flex};
+ $desc = shift;
+ }
+ else {
+ $desc = $flex;
+ }
+ } # parms left
+
+ if ( not defined $desc ) {
+ $url = $url->url if ref($url) eq 'WWW::Mechanize::Link';
+ $desc = "$method $url";
+ }
+
+ return ($url, $desc, %opts);
+}
+
+
=head1 METHODS: CONTENT CHECKING
@@ -766,7 +704,7 @@
my $self = shift;
my $regex = shift;
my $desc = shift;
- $desc = qq{Content is like "$regex"} if !defined($desc);
+ $desc = qq{Content is unlike "$regex"} if !defined($desc);
local $Test::Builder::Level = $Test::Builder::Level + 1;
return unlike_string( $self->content, $regex, $desc );
@@ -1392,10 +1330,20 @@
=head1 COPYRIGHT & LICENSE
-Copyright 2004-2008 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.
+Copyright 2004-2009 Andy Lester.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of either:
+
+=over 4
+
+=item * the GNU General Public License as published by the Free
+Software Foundation; either version 1, or (at your option) any
+later version, or
+
+=item * the Artistic License version 2.0.
+
+=back
=cut
Modified: branches/upstream/libtest-www-mechanize-perl/current/t/content_contains.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/t/content_contains.t?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/t/content_contains.t (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/t/content_contains.t Tue Apr 6 21:07:41 2010
@@ -32,9 +32,11 @@
test_test( 'Finds the contains - default desc' );
test_out( 'not ok 1 - Where is Mungo?' );
-test_fail(+3);
-test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"...) );
+test_fail(+5);
+test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) );
test_diag(q( can't find: "Mungo") );
+test_diag(q( LCSS: "go"));
+test_diag(q(LCSS context: "dy>\x{0a} <h1>Test Page</h1>\x{0a} <a href="go"));
$mech->content_contains( 'Mungo', 'Where is Mungo?' );
test_test( 'Handles not finding it' );
Modified: branches/upstream/libtest-www-mechanize-perl/current/t/content_lacks.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/t/content_lacks.t?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/t/content_lacks.t (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/t/content_lacks.t Tue Apr 6 21:07:41 2010
@@ -33,9 +33,9 @@
test_out( q{not ok 1 - Shouldn't say it's a test page} );
test_fail(+4);
-test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>\x{0a} </h"...) );
+test_diag(q( searched: "<html>\x{0a} <head>\x{0a} <title>Test Page</title>"...) );
test_diag(q( and found: "Test Page") );
-test_diag(q( at position: 27) );
+test_diag(q( at position: 33) );
$mech->content_lacks( 'Test Page', q{Shouldn't say it's a test page} );
test_test( 'Handles not finding it' );
Modified: branches/upstream/libtest-www-mechanize-perl/current/t/html/goodlinks.html
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/t/html/goodlinks.html?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/t/html/goodlinks.html (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/t/html/goodlinks.html Tue Apr 6 21:07:41 2010
@@ -1,12 +1,12 @@
<html>
- <head>
- <title>Test Page</title>
- </head>
- <body>
- <h1>Test Page</h1>
- <a href='goodlinks.html'>Test 1</a>
- <a href='badlinks.html'>Test 2</a>
- <a href='goodlinks.html'>Test 3</a>
- </body>
+ <head>
+ <title>Test Page</title>
+ </head>
+ <body>
+ <h1>Test Page</h1>
+ <a href="goodlinks.html">Test 1</a>
+ <a href="badlinks.html">Test 2</a>
+ <a href="goodlinks.html">Test 3</a>
+ </body>
</html>
Modified: branches/upstream/libtest-www-mechanize-perl/current/t/put_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-www-mechanize-perl/current/t/put_ok.t?rev=55560&op=diff
==============================================================================
--- branches/upstream/libtest-www-mechanize-perl/current/t/put_ok.t (original)
+++ branches/upstream/libtest-www-mechanize-perl/current/t/put_ok.t Tue Apr 6 21:07:41 2010
@@ -24,13 +24,15 @@
my $pid = $server->background;
my $server_root = $server->root;
+diag( 'Any help in squashing the warnings in this test would be appreciated' );
my $mech = Test::WWW::Mechanize->new( autocheck => 0 );
isa_ok($mech,'Test::WWW::Mechanize');
+my $text = 'This is what we are putting';
GOOD_PUT: {
my $goodlinks = "$server_root/goodlinks.html";
- $mech->put($goodlinks);
+ $mech->put($goodlinks, $text);
ok($mech->success, 'sanity check: we can load goodlinks.html');
test_out('ok 1 - Try to PUT goodlinks.html');
@@ -47,7 +49,7 @@
BAD_PUT: {
my $badurl = 'http://wango.nonexistent.xx-only-testing/';
- $mech->put($badurl);
+ $mech->put($badurl, $text);
ok(!$mech->success, q{sanity check: we can't load NONEXISTENT.html});
test_out( 'not ok 1 - Try to PUT bad URL' );
More information about the Pkg-perl-cvs-commits
mailing list