[Bps-public-commit] www-mechanize branch, master, updated. 1.72-1-gda11c71
Jesse Vincent
jesse at bestpractical.com
Sat Mar 24 14:45:09 EDT 2012
The branch, master has been updated
via da11c71577b92190966335fda72070259f153822 (commit)
from 657174d8225cf588ad54d86d161a835a6cfcbb2c (commit)
Summary of changes:
Changes | 6 ++++++
t/local/back.t | 22 ++++------------------
2 files changed, 10 insertions(+), 18 deletions(-)
- Log -----------------------------------------------------------------
commit da11c71577b92190966335fda72070259f153822
Author: Matt S Trout <mst at shadowcat.co.uk>
Date: Sat Mar 24 18:08:30 2012 +0000
remove last manual fork() to create a server in t/local/back.t so win32 stops emitting black smoke
diff --git a/Changes b/Changes
index 07cc285..a275dda 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,12 @@ Revision history for WWW::Mechanize
Mech now has its own mailing list at Google Groups:
http://groups.google.com/group/www-mechanize-users
+[TESTS]
+
+Update t/local/back.t to use LocalServer for 404 checking to avoid fails
+on win32. Fix by Matt S Trout, patient diagnostics and testing provided
+by jayefuu of freenode #perl
+
[CHANGES]
1.72 Thu Feb 2 18:37:28 EST 2012
diff --git a/t/local/back.t b/t/local/back.t
index 86569f8..8188543 100644
--- a/t/local/back.t
+++ b/t/local/back.t
@@ -2,7 +2,7 @@
use warnings;
use strict;
-use Test::More tests => 47;
+use Test::More tests => 48;
use lib qw( t t/local );
use LocalServer;
use HTTP::Daemon;
@@ -128,24 +128,10 @@ my @links = qw(
is( scalar @{$mech->{page_stack}}, 0, 'Pre-404 check' );
-my $server404 = HTTP::Daemon->new(LocalAddr => 'localhost') or die;
-my $server404url = $server404->url;
+my $server404 = LocalServer->spawn( html => '<html><body>ARGH</body></html>' );
+isa_ok( $server404, 'LocalServer' );
-die 'Cannot fork' if (! defined (my $pid404 = fork()));
-END {
- local $?;
- kill KILL => $pid404 if $pid404; # Extreme prejudice intended, because we do not
- # want the global cleanup to be done twice.
-}
-
-if (! $pid404) { # Fake HTTP server code: a true 404-compliant server!
- while ( my $c = $server404->accept() ) {
- while ( $c->get_request() ) {
- $c->send_response( HTTP::Response->new(404) );
- $c->close();
- }
- }
-}
+my $server404url = $server404->error_notfound('404check');
$mech->get($server404url);
is( $mech->status, 404 , '404 check') or
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list