Sha256: e43e4f6076a9e5aa736590f9cc030309428ed7ff6b819eb980b1d19d54dd5c48

Contents?: true

Size: 982 Bytes

Versions: 4

Compression:

Stored size: 982 Bytes

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'ym4r/google_maps/geocoding'
require 'test/unit'

include Ym4r::GoogleMaps

class TestGmGeocoding< Test::Unit::TestCase
  def test_google_maps_geocoding
    placemarks = Ym4r::GoogleMaps::Geocoding.get("Rue Clovis Paris")
    assert_equal(Ym4r::GoogleMaps::Geocoding::GEO_SUCCESS,placemarks.status)
    assert_equal(1,placemarks.length)
    placemark = placemarks[0]
    assert_equal("FR",placemark.country_code)
    assert_equal("Paris",placemark.locality)
    assert_equal("75005",placemark.postal_code)
  end

  def test_google_maps_pakistan
    placemarks = Ym4r::GoogleMaps::Geocoding.get("Lahore PK")
    assert_equal(Ym4r::GoogleMaps::Geocoding::GEO_SUCCESS,placemarks.status)
    assert_equal(1,placemarks.length)
    placemark = placemarks[0]
    assert_equal("PK",placemark.country_code)
    assert_equal("Lahore",placemark.locality)
    assert_equal("",placemark.thoroughfare)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ym4r-0.5.1 test/test_gm_geocoding.rb
ym4r-0.5.4 test/test_gm_geocoding.rb
ym4r-0.5.3 test/test_gm_geocoding.rb
ym4r-0.5.2 test/test_gm_geocoding.rb