r77369 - in /trunk/libgeo-coder-googlev3-perl: Changes META.yml debian/changelog lib/Geo/Coder/Googlev3.pm t/geocode.t

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Mon Jul 11 15:52:44 UTC 2011


Author: emhn-guest
Date: Mon Jul 11 15:52:35 2011
New Revision: 77369

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77369
Log:
Latest upstream release skips tests if there's no network access.
Ready for release.

Modified:
    trunk/libgeo-coder-googlev3-perl/Changes
    trunk/libgeo-coder-googlev3-perl/META.yml
    trunk/libgeo-coder-googlev3-perl/debian/changelog
    trunk/libgeo-coder-googlev3-perl/lib/Geo/Coder/Googlev3.pm
    trunk/libgeo-coder-googlev3-perl/t/geocode.t

Modified: trunk/libgeo-coder-googlev3-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-coder-googlev3-perl/Changes?rev=77369&op=diff
==============================================================================
--- trunk/libgeo-coder-googlev3-perl/Changes (original)
+++ trunk/libgeo-coder-googlev3-perl/Changes Mon Jul 11 15:52:35 2011
@@ -1,4 +1,13 @@
 Revision history for Perl extension Geo::Coder::Googlev3.
+
+0.09
+	- default LWP::UserAgent object sets env_proxy
+	  [rt.cpan.org #66480] and sets timeout to 15s
+	- tests are skipped if there's no network connection
+	  [rt.cpan.org #65873]
+
+0.08
+	- fixed test for changed results [rt.cpan.org #68437]
 
 0.07
 	- ZERO_RESULTS is not anymore an error, but is returned as an

Modified: trunk/libgeo-coder-googlev3-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-coder-googlev3-perl/META.yml?rev=77369&op=diff
==============================================================================
--- trunk/libgeo-coder-googlev3-perl/META.yml (original)
+++ trunk/libgeo-coder-googlev3-perl/META.yml Mon Jul 11 15:52:35 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Geo-Coder-Googlev3
-version:            0.07
+version:            0.09
 abstract:           Google Maps v3 Geocoding API 
 author:
     - Slaven Rezic <srezic at cpan.org>

Modified: trunk/libgeo-coder-googlev3-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-coder-googlev3-perl/debian/changelog?rev=77369&op=diff
==============================================================================
--- trunk/libgeo-coder-googlev3-perl/debian/changelog (original)
+++ trunk/libgeo-coder-googlev3-perl/debian/changelog Mon Jul 11 15:52:35 2011
@@ -1,8 +1,5 @@
-libgeo-coder-googlev3-perl (0.07-1) UNRELEASED; urgency=low
-
-  TODO:
-  tests fails without internet access
+libgeo-coder-googlev3-perl (0.09-1) unstable; urgency=low
 
   * Initial Release (Closes: #625499).
 
- -- Ernesto Hernández-Novich (USB) <emhn at usb.ve>  Wed, 04 May 2011 09:38:46 -0430
+ -- Ernesto Hernández-Novich (USB) <emhn at usb.ve>  Mon, 11 Jul 2011 11:21:05 -0430

Modified: trunk/libgeo-coder-googlev3-perl/lib/Geo/Coder/Googlev3.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-coder-googlev3-perl/lib/Geo/Coder/Googlev3.pm?rev=77369&op=diff
==============================================================================
--- trunk/libgeo-coder-googlev3-perl/lib/Geo/Coder/Googlev3.pm (original)
+++ trunk/libgeo-coder-googlev3-perl/lib/Geo/Coder/Googlev3.pm Mon Jul 11 15:52:35 2011
@@ -12,7 +12,7 @@
 
 use strict;
 use vars qw($VERSION);
-our $VERSION = '0.07';
+our $VERSION = '0.09';
 
 use Carp            ('croak');
 use Encode          ();
@@ -24,7 +24,12 @@
 sub new {
     my($class, %args) = @_;
     my $self = bless {}, $class;
-    $self->{ua}       = delete $args{ua} || LWP::UserAgent->new(agent => __PACKAGE__ . "/$VERSION libwww-perl/$LWP::VERSION");
+    $self->{ua}       = delete $args{ua} ||
+        LWP::UserAgent->new(
+                            agent     => __PACKAGE__ . "/$VERSION libwww-perl/$LWP::VERSION",
+                            env_proxy => 1,
+                            timeout   => 15,
+                           );
     $self->{region}   = delete $args{region} || delete $args{gl};
     $self->{language} = delete $args{language};
     croak "Unsupported arguments: " . join(" ", %args) if %args;
@@ -115,6 +120,10 @@
 
 Creates a new geocoding object.
 
+The C<ua> parameter may be supplied to override the default
+L<LWP::UserAgent> object. The default C<LWP::UserAgent> object sets
+the C<timeout> to 15 seconds and enables the C<env_proxy> option.
+
 The L<Geo::Coder::Google>'s C<oe> and C<apikey> parameters are not
 supported.
 

Modified: trunk/libgeo-coder-googlev3-perl/t/geocode.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libgeo-coder-googlev3-perl/t/geocode.t?rev=77369&op=diff
==============================================================================
--- trunk/libgeo-coder-googlev3-perl/t/geocode.t (original)
+++ trunk/libgeo-coder-googlev3-perl/t/geocode.t Mon Jul 11 15:52:35 2011
@@ -5,17 +5,30 @@
 
 sub within ($$$$$$);
 
-plan tests => 30;
+my $real_tests = 28;
+plan tests => 2 + $real_tests;;
 
 use_ok 'Geo::Coder::Googlev3';
 
 my $geocoder = Geo::Coder::Googlev3->new;
 isa_ok $geocoder, 'Geo::Coder::Googlev3';
 
+SKIP: {
+
 { # list context
-    my @locations = $geocoder->geocode(location => 'Berliner Straße, Berlin, Germany');
-    cmp_ok scalar(@locations), ">", 1, "More than one result found"; # There are eight hits in Berlin, Google knows seven of them
-    like $locations[0]->{formatted_address}, qr{Berliner Straße}, 'First result looks OK';
+    ## There are eight hits in Berlin. Google uses to know seven of them.
+    ## But beginning from approx. 2010-05, only one location is returned.
+    #my @locations = $geocoder->geocode(location => 'Berliner Straße, Berlin, Germany');
+    #cmp_ok scalar(@locations), ">=", 1, "One or more results found";
+    #like $locations[0]->{formatted_address}, qr{Berliner Straße}, 'First result looks OK';
+
+    my @locations = eval { $geocoder->geocode(location => 'Waterloo, UK') };
+    if ($@ =~ m{Fetching.*failed: 500}) {
+	diag $@;
+	skip "Fetch failed, probably network connection problems", $real_tests;
+    }
+    cmp_ok scalar(@locations), ">", 1, "More than one result found";
+    like $locations[0]->{formatted_address}, qr{Waterloo}, 'First result looks OK';
 }
 
 {
@@ -92,6 +105,8 @@
     }
 }
 
+}
+
 sub within ($$$$$$) {
     my($lat,$lng,$lat_min,$lat_max,$lng_min,$lng_max) = @_;
     cmp_ok $lat, ">=", $lat_min;




More information about the Pkg-perl-cvs-commits mailing list