lib/pokemon_go_server_status.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 36 CC 2 SCAR 12.0
CC
2
Cov
0%
get_server_status
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package pokemon_go_server_status;
2  
3 use warnings;
4 use strict;
5  
6 our $VERSION = 1.00;
7  
8 use WWW::Mechanize::Timed;
9  
10 use Exporter 'import';
11 our @EXPORT = qw( get_server_status );
12  
13 sub get_server_status {
14 my $ua = WWW::Mechanize::Timed->new();
15 my $result;
16 eval {
17 $ua->get('https://pgorelease.nianticlabs.com/plfe/');
18 if ($ua->client_elapsed_time < 3) {
19 $result = 'Go! catch them all!';
20 } else {
21 $result = 'Servers are down, go back to work';
22 }
23 1;
24 } or do {
25 $result = 'Go! Cacth them all!';
26 };
27 $result
28 }
29  
30 1;