Addr-MyIP
view release on metacpan or search on metacpan
Revision history for Addr-MyIP
0.05 2022-05-17
- Renamed distribution to Addr::MyIP from Net::MyIP due to the latter being
in BackPAN, breaking my release
0.04 2022-05-13
- s/distmgr/myip/ in module POD description
0.03 2022-05-11
- Print response content (error message) if API failure occurs
- Add prereq of Hook::Output::Tiny for testing a non-200 API response
0.02 2022-05-11
- POD fixes
- Modifications to Github CI Actions configuration
0.01 2022-05-11
- Auto generated distribution with Dist::Mgr
t/05-ipv4.t view on Meta::CPAN
$h->hook;
my $ip = myip();
$h->unhook;
my @stderr = $h->stderr;
like
$stderr[0],
qr/Unauthorized/,
"on unsuccessful API call, display the error";
is $get_sub->called_count, 1, "HTTP client get called ok (mocked)";
is $ip, '', "myip() returns empty string on API fail ok";
}
}
if ($ENV{DEV_TESTING} || $ENV{RELEASE_TESTING}) {
# Valid return
{
my $ip = myip();
like
t/10-ipv6.t view on Meta::CPAN
$h->hook;
my $ip = myip6();
$h->unhook;
my @stderr = $h->stderr;
like
$stderr[0],
qr/Unauthorized/,
"on unsuccessful API call, display the error";
is $get_sub->called_count, 1, "HTTP client get called ok (mocked)";
is $ip, '', "myip() returns empty string on API fail ok";
}
}
if ($ENV{DEV_TESTING} || $ENV{RELEASE_TESTING}) {
# Valid return
{
my $ip = myip6();
( run in 0.294 second using v1.01-cache-2.11-cpan-65fba6d93b7 )