Skip to content

Commit

Permalink
skip test if Geo::IP database is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Sep 3, 2014
1 parent a3862ac commit 5258a0e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions t/01-adserver.t
Expand Up @@ -8,6 +8,7 @@ plan tests => 8;

use WWW::AdServer;
use WWW::AdServer::Database;
use Geo::IP;

my $ads = WWW::AdServer->new;
isa_ok($ads, 'WWW::AdServer');
Expand Down Expand Up @@ -65,8 +66,12 @@ subtest 'IL' => sub {
};

subtest 'geoip' => sub {
use Geo::IP;
my $gi = Geo::IP->new(GEOIP_MEMORY_CACHE);
my $gi;
eval {
$gi = Geo::IP->new(GEOIP_MEMORY_CACHE);
};
plan skip_all => 'Geo::IP is not working' if $@ or not defined $gi;

my %data = (
'24.24.24.24' => 'US',
'86.59.162.2' => 'HU',
Expand Down

0 comments on commit 5258a0e

Please sign in to comment.