From 076a2ebd7a9ec2f3d002fcd45278200fbea72242 Mon Sep 17 00:00:00 2001 From: Alex Reisner <alex@alexreisner.com> Date: Fri, 4 Mar 2011 01:11:33 -0500 Subject: [PATCH] Include country in address. --- lib/geocoder/results/yahoo.rb | 2 +- test/geocoder_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/geocoder/results/yahoo.rb b/lib/geocoder/results/yahoo.rb index 3f964fa2..ffbf3f71 100644 --- a/lib/geocoder/results/yahoo.rb +++ b/lib/geocoder/results/yahoo.rb @@ -8,7 +8,7 @@ module Geocoder::Result end def address(format = :full) - (1..3).to_a.map{ |i| @data["line#{i}"] }.reject{ |i| i.nil? or i == "" }.join(", ") + (1..4).to_a.map{ |i| @data["line#{i}"] }.reject{ |i| i.nil? or i == "" }.join(", ") end def self.response_attributes diff --git a/test/geocoder_test.rb b/test/geocoder_test.rb index 4dfa26e5..6b6042ca 100644 --- a/test/geocoder_test.rb +++ b/test/geocoder_test.rb @@ -58,7 +58,7 @@ class GeocoderTest < Test::Unit::TestCase Geocoder::Configuration.lookup = :yahoo Geocoder.send :set_lookup, :yahoo results = Geocoder.search("Madison Square Garden, New York, NY") - assert_equal "Madison Square Garden, New York, NY 10001", + assert_equal "Madison Square Garden, New York, NY 10001, United States", results.first.address end end -- GitLab