Debian Codegraph @

README

raw
1 NAME
2 Test::RequiresInternet - Easily test network connectivity
3
4 VERSION
5 version 0.05
6
7 SYNOPSIS
8 use Test::More;
9 use Test::RequiresInternet ('www.example.com' => 80, 'foobar.io' => 25);
10
11 # if you reach here, sockets successfully connected to hosts/ports above
12 plan tests => 1;
13
14 ok(do_that_internet_thing());
15
16 OVERVIEW
17 This module is intended to easily test network connectivity before
18 functional tests begin to non-local Internet resources. It does not
19 require any modules beyond those supplied in core Perl.
20
21 If you do not specify a host/port pair, then the module defaults to
22 using "www.google.com" on port 80.
23
24 You may optionally specify the port by its name, as in "http" or "ldap".
25 If you do this, the test module will attempt to look up the port number
26 using "getservbyname".
27
28 If you do specify a host and port, they must be specified in pairs. It
29 is a fatal error to omit one or the other.
30
31 If the environment variable "NO_NETWORK_TESTING" is set, then the tests
32 will be skipped without attempting any socket connections.
33
34 If the sockets cannot connect to the specified hosts and ports, the
35 exception is caught, reported and the tests skipped.
36
37 AUTHOR
38 Mark Allen <[email protected]>
39
40 COPYRIGHT AND LICENSE
41 This software is copyright (c) 2014 by Mark Allen.
42
43 This is free software; you can redistribute it and/or modify it under
44 the same terms as the Perl 5 programming language system itself.
45