🌻 📖 Test2::Require::Internet

NAME

Test2::Require::Internet - Skip tests if there is no internet access

VERSION

version 0.12

SYNOPSIS

 use Test2::V0;
 use Test2::Require::Internet;
 use HTTP::Tiny;
 
 # we are safe to use the internets
 ok(HTTP::Tiny->get('http://www.example.com')->{success});
 
 done_testing;

DESCRIPTION

This test requirement will skip your test if either

The environment variable NO_NETWORK_TESTING is set to a true value
A connection to a particular host/port cannot be made. The default is usually reasonable, but subject to change as the author sees fit.

This module uses the standard Test2::Require interface. Only TCP checks can be made at the moment. Other protocols/methods may be added later.

SEE ALSO

Test::RequiresInternet

This module provides similar functionality but does not use Test::Builder or Test2::API.

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018-2022 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.