WWW-Mechanize

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

        * t/taint.t makes sure that things that should be tainted are.

        [FIXES]
        * Still more fixes if the machine you're on doesn't have
          DNS pointing to it.

        * The local changes use localhost as the local host name, instead
          of whatever host name that might be on the box, but not in DNS.
          Thanks to David Wheeler for letting me play on his box.

        * The http_proxy and HTTP_PROXY environment variables get
          deleted during the tests that access the dummy local server.
          This should let your tests pass, and clear up a lot of RT
          tickets.

0.72    Mon Jan 26 21:07:20 CST 2004
        [ENHANCEMENTS]
        * Added the set_visible() method, thanks to Peter Scott.

        [DOCUMENTATION]
        * Started the Cookbook at WWW::Mechanize::Cookbook.pod.

t/content.t  view on Meta::CPAN

=head1 NAME

content.t

=head1 SYNOPSIS

Tests the transforming forms of $mech->content().

=cut

BEGIN { delete @ENV{qw( http_proxy HTTP_PROXY )}; }

BEGIN {
    use_ok('WWW::Mechanize');
}

my $html = <<'HTML';
<html>
<head>
<title>Howdy?</title>
</head>

t/cookies.t  view on Meta::CPAN

# XXX add cookie reading on the server side to the test

BEGIN { delete @ENV{qw( http_proxy HTTP_PROXY )}; }

use warnings;
use strict;
use Test::More;

if ( $^O =~ /Win32/ ) {
    plan skip_all => 'HTTP::Server::Simple does not support Windows yet.';
}
else {
    plan tests => 14;

t/local/LocalServer.pm  view on Meta::CPAN


# start a fake webserver, fork, and connect to ourselves
use warnings;
use strict;

# this has to happen here because LWP::Simple creates a $ua
# on load so any time after this is too late.
BEGIN {
    delete @ENV{
        qw(
            HTTP_PROXY http_proxy CGI_HTTP_PROXY
            HTTPS_PROXY https_proxy HTTP_PROXY_ALL http_proxy_all
        )
    };
}

use Carp        qw( carp croak );
use File::Temp  ();
use LWP::Simple qw( get );
use Path::Tiny  qw( path );
use URI::URL    ();

t/local/LocalServer.pm  view on Meta::CPAN

server would be

  eval => sleep+10

=back

All served HTML will have the first %s replaced by the current location.

The following entries will be removed from C<%ENV>:

    HTTP_PROXY
    http_proxy
    CGI_HTTP_PROXY
    HTTPS_PROXY
    https_proxy
    HTTP_PROXY_ALL
    http_proxy_all

=cut

sub spawn {
    my ( $class, %args ) = @_;
    my $self = {%args};
    bless $self, $class;

    local $ENV{TEST_HTTP_VERBOSE};

t/local/referer.t  view on Meta::CPAN

    delete @ENV{qw( IFS CDPATH ENV BASH_ENV )};
    use_ok('WWW::Mechanize');
}

our $server;
my $agent = WWW::Mechanize->new();
isa_ok( $agent, 'WWW::Mechanize' );

SKIP: {
    # We want to be safe from non-resolving local host names
    delete $ENV{HTTP_PROXY};

    # Now start a fake webserver, fork, and connect to ourselves
    my $command = qq'"$^X" "$FindBin::Bin/referer-server"';
    if ( $^O eq 'VMS' ) {
        $command = qq'mcr $^X t/referer-server';
    }

    open $server, "$command |" or die "Couldn't spawn fake server: $!";
    sleep 1;    # give the child some time
    my $url = <$server>;

t/local/select_multiple.t  view on Meta::CPAN

use warnings;
use strict;
use Test::More;
use Test::Fatal qw( dies_ok );

use lib 't/local';
use LocalServer ();

BEGIN {
    use_ok('WWW::Mechanize');
    delete @ENV{qw( http_proxy HTTP_PROXY )};
    delete @ENV{qw( IFS CDPATH ENV BASH_ENV )};

}

my $mech = WWW::Mechanize->new( cookie_jar => {} );
isa_ok( $mech, "WWW::Mechanize" );
ok(
    defined( $mech->cookie_jar() ),
    'this $mech starts with a cookie jar'
);

t/upload.t  view on Meta::CPAN

#!perl

use strict;
use warnings;
use Test::More tests => 5;
use URI::file ();

BEGIN {
    delete @ENV{qw( http_proxy HTTP_PROXY PATH IFS CDPATH ENV BASH_ENV)};
}
use_ok('WWW::Mechanize');

my $mech = WWW::Mechanize->new( cookie_jar => undef );
isa_ok( $mech, 'WWW::Mechanize' );

my $uri = URI::file->new_abs('t/upload.html')->as_string;
$mech->get($uri);
ok( $mech->success, $uri );



( run in 0.931 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )