test/test_geoplugin_geocoder.rb in geokit-1.7.0 vs test/test_geoplugin_geocoder.rb in geokit-1.7.1
- old
+ new
@@ -27,12 +27,12 @@
def test_successful_lookup
success = MockSuccess.new
success.expects(:body).returns(IP_SUCCESS)
url = 'http://www.geoplugin.net/xml.gp?ip=200.150.38.66'
- GeoKit::Geocoders::GeoPluginGeocoder.expects(:call_geocoder_service).with(url).returns(success)
- location = GeoKit::Geocoders::GeoPluginGeocoder.geocode('200.150.38.66')
+ Geokit::Geocoders::GeoPluginGeocoder.expects(:call_geocoder_service).with(url).returns(success)
+ location = Geokit::Geocoders::GeoPluginGeocoder.geocode('200.150.38.66')
assert_not_nil location
assert_equal(-19.916700, location.lat)
assert_equal(-43.933300, location.lng)
assert_equal "Belo Horizonte", location.city
assert_equal "Minas Gerais", location.state
@@ -40,19 +40,19 @@
assert_equal "geoPlugin", location.provider
assert location.success?
end
def test_invalid_ip
- location = GeoKit::Geocoders::GeoPluginGeocoder.geocode("pixrum")
+ location = Geokit::Geocoders::GeoPluginGeocoder.geocode("pixrum")
assert_not_nil location
assert !location.success?
end
def test_service_unavailable
failure = MockFailure.new
url = 'http://www.geoplugin.net/xml.gp?ip=10.10.10.10'
- GeoKit::Geocoders::GeoPluginGeocoder.expects(:call_geocoder_service).with(url).returns(failure)
- location = GeoKit::Geocoders::GeoPluginGeocoder.geocode("10.10.10.10")
+ Geokit::Geocoders::GeoPluginGeocoder.expects(:call_geocoder_service).with(url).returns(failure)
+ location = Geokit::Geocoders::GeoPluginGeocoder.geocode("10.10.10.10")
assert_not_nil location
assert !location.success?
end
end