From 49fabe633e3a1f1b8d6b164929a498d9e48dcc38 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Mon, 30 Sep 2013 19:03:51 -0700 Subject: start --- t/00-load.t | 9 +++++++++ t/01-geocode.t | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 t/00-load.t create mode 100644 t/01-geocode.t (limited to 't') diff --git a/t/00-load.t b/t/00-load.t new file mode 100644 index 0000000..89be297 --- /dev/null +++ b/t/00-load.t @@ -0,0 +1,9 @@ +#!perl -T + +use Test::More tests => 1; + +BEGIN { + use_ok( 'Geo::TomTom::Geocoding' ) || print "Bail out!\n"; +} + +diag( "Testing Geo::TomTom::Geocoding $Geo::TomTom::Geocoding::VERSION, Perl $], $^X" ); 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/ ); + +} + -- cgit v1.2.1