start
[Geo-TomTom-Geocoding.git] / t / 01-geocode.t
1 #!perl
2
3 use Test::More tests => 1;
4 use Geo::TomTom::Geocoding;
5
6 SKIP: {
7   my $key = $ENV{TOMTOM_API_KEY};
8   skip("TOMTOM_API_KEY not set", 1) unless $key;
9
10   my $test_loc = [
11     key => $key,
12     ST  => 55,
13     T   => 'Music Concourse Drive',
14     L   => 'San Francisco',
15     AA  => 'CA',
16     CC  => 'USA',
17   ];
18   my $response = Geo::TomTom::Geocoding->query($test_loc);
19   my ($first_match) = $response->locations;
20   note "Test results:\n".explain $first_match;
21   ok( $first_match->{postcode} =~ /^94118/ );
22
23 }
24