<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,8 +4,8 @@ require File.join(File.dirname(__FILE__), 'test_base_geocoder')
 class IpGeocoderTest &lt; BaseGeocoderTest #:nodoc: all
     
   IP_FAILURE=&lt;&lt;-EOF
-    Country: (Private Address) (XX)
-    City: (Private Address)
+    Country: SWITZERLAND (CH)
+    City: (Unknown City)
     Latitude: 
     Longitude:
     EOF
@@ -24,10 +24,22 @@ class IpGeocoderTest &lt; BaseGeocoderTest #:nodoc: all
     Longitude: 12.9167
     EOF
     
-    def setup
-      super
-      @success.provider = &quot;hostip&quot;
-    end    
+  PRIVATE_IPS_TO_TEST = [
+    '10.10.10.10',
+    '172.16.1.3',
+    '172.22.3.42',
+    '172.30.254.164',
+    '192.168.1.1',
+    '0.0.0.0',
+    '127.0.0.1',
+    '240.3.4.5',
+    '225.1.6.55'
+  ].freeze
+
+  def setup
+    super
+    @success.provider = &quot;hostip&quot;
+  end    
   
   def test_successful_lookup
     success = MockSuccess.new
@@ -64,14 +76,24 @@ class IpGeocoderTest &lt; BaseGeocoderTest #:nodoc: all
   def test_failed_lookup
     failure = MockSuccess.new
     failure.expects(:body).returns(IP_FAILURE)
-    url = 'http://api.hostip.info/get_html.php?ip=10.10.10.10&amp;position=true'
+    url = 'http://api.hostip.info/get_html.php?ip=128.178.0.0&amp;position=true'
     GeoKit::Geocoders::IpGeocoder.expects(:call_geocoder_service).with(url).returns(failure)
-    location = GeoKit::Geocoders::IpGeocoder.geocode(&quot;10.10.10.10&quot;)
+    location = GeoKit::Geocoders::IpGeocoder.geocode(&quot;128.178.0.0&quot;)
     assert_not_nil location
     assert !location.success?
   end
   
+  def test_private_ips
+    GeoKit::Geocoders::IpGeocoder.expects(:call_geocoder_service).never
+    PRIVATE_IPS_TO_TEST.each do |ip|
+      location = GeoKit::Geocoders::IpGeocoder.geocode(ip)
+      assert_not_nil location
+      assert !location.success?
+    end
+  end
+  
   def test_invalid_ip
+    GeoKit::Geocoders::IpGeocoder.expects(:call_geocoder_service).never
     location = GeoKit::Geocoders::IpGeocoder.geocode(&quot;blah&quot;)
     assert_not_nil location
     assert !location.success?
@@ -79,9 +101,9 @@ class IpGeocoderTest &lt; BaseGeocoderTest #:nodoc: all
   
   def test_service_unavailable
     failure = MockFailure.new
-    url = 'http://api.hostip.info/get_html.php?ip=10.10.10.10&amp;position=true'
+    url = 'http://api.hostip.info/get_html.php?ip=12.215.42.19&amp;position=true'
     GeoKit::Geocoders::IpGeocoder.expects(:call_geocoder_service).with(url).returns(failure)
-    location = GeoKit::Geocoders::IpGeocoder.geocode(&quot;10.10.10.10&quot;)
+    location = GeoKit::Geocoders::IpGeocoder.geocode(&quot;12.215.42.19&quot;)
     assert_not_nil location
     assert !location.success?
   end  </diff>
      <filename>test/test_ipgeocoder.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5fe4ee6d500f522b3a098f56aea7740c5b29f00d</id>
    </parent>
    <parent>
      <id>ba9239f38fd526b8c0346308e1ad5c10944b6581</id>
    </parent>
  </parents>
  <author>
    <name>Andre Lewis</name>
    <email>andre@highgroove.com</email>
  </author>
  <url>http://github.com/andre/geokit-gem/commit/e6ff6d614bd6fce16a489146f025bab9dc233857</url>
  <id>e6ff6d614bd6fce16a489146f025bab9dc233857</id>
  <committed-date>2009-09-21T02:38:25-07:00</committed-date>
  <authored-date>2009-09-21T02:38:25-07:00</authored-date>
  <message>Merge branch 'master' of git://github.com/Sjlver/geokit-gem</message>
  <tree>79473e9d763c3c9ff0418babc0a9b074ea6e31aa</tree>
  <committer>
    <name>Andre Lewis</name>
    <email>andre@highgroove.com</email>
  </committer>
</commit>
