summaryrefslogtreecommitdiff
path: root/t/01-geocode.t
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-09-30 19:03:51 -0700
committerMark Wells <mark@freeside.biz>2013-09-30 19:03:51 -0700
commit49fabe633e3a1f1b8d6b164929a498d9e48dcc38 (patch)
tree80afc964a7a75e7fcab493bb405a0d064e595298 /t/01-geocode.t
start
Diffstat (limited to 't/01-geocode.t')
-rw-r--r--t/01-geocode.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/01-geocode.t b/t/01-geocode.t
new file mode 100644
index 0000000..a53e145
--- /dev/null
+++ b/t/01-geocode.t
@@ -0,0 +1,24 @@
+#!perl
+
+use Test::More tests => 1;
+use Geo::TomTom::Geocoding;
+
+SKIP: {
+ my $key = $ENV{TOMTOM_API_KEY};
+ skip("TOMTOM_API_KEY not set", 1) unless $key;
+
+ my $test_loc = [
+ key => $key,
+ ST => 55,
+ T => 'Music Concourse Drive',
+ L => 'San Francisco',
+ AA => 'CA',
+ CC => 'USA',
+ ];
+ my $response = Geo::TomTom::Geocoding->query($test_loc);
+ my ($first_match) = $response->locations;
+ note "Test results:\n".explain $first_match;
+ ok( $first_match->{postcode} =~ /^94118/ );
+
+}
+