<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/boot.rb</filename>
    </added>
    <added>
      <filename>test/models/company.rb</filename>
    </added>
    <added>
      <filename>test/models/custom_location.rb</filename>
    </added>
    <added>
      <filename>test/models/location.rb</filename>
    </added>
    <added>
      <filename>test/models/mock_address.rb</filename>
    </added>
    <added>
      <filename>test/models/mock_family.rb</filename>
    </added>
    <added>
      <filename>test/models/mock_house.rb</filename>
    </added>
    <added>
      <filename>test/models/mock_organization.rb</filename>
    </added>
    <added>
      <filename>test/models/mock_person.rb</filename>
    </added>
    <added>
      <filename>test/models/store.rb</filename>
    </added>
    <added>
      <filename>test/mysql-debug.log</filename>
    </added>
    <added>
      <filename>test/tasks.rake</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,16 +2,11 @@ require 'rake'
 require 'rake/testtask'
 require 'rake/rdoctask'
 
+load 'test/tasks.rake'
+
 desc 'Default: run unit tests.'
 task :default =&gt; :test
 
-desc 'Test the GeoKit plugin.'
-Rake::TestTask.new(:test) do |t|
-  t.libs &lt;&lt; 'lib'
-  t.pattern = 'test/**/*_test.rb'
-  t.verbose = true
-end
-
 desc 'Generate documentation for the GeoKit plugin.'
 Rake::RDocTask.new(:rdoc) do |rdoc|
   rdoc.rdoc_dir = 'rdoc'</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,75 +1,12 @@
-require 'rubygems'
-require 'mocha'
-require File.join(File.dirname(__FILE__), 'test_helper')
+require 'test_helper'
 
-Geokit::Geocoders::provider_order = [:google, :us]
-
-# Uses defaults
-class Company &lt; ActiveRecord::Base #:nodoc: all
-  has_many :locations
-end
-
-# Configures everything.
-class Location &lt; ActiveRecord::Base #:nodoc: all
-  belongs_to :company
-  acts_as_mappable
-end
-
-# for auto_geocode
-class Store &lt; ActiveRecord::Base
-  acts_as_mappable :auto_geocode =&gt; true
-end
-
-# Uses deviations from conventions.
-class CustomLocation &lt; ActiveRecord::Base #:nodoc: all
-  belongs_to :company
-  acts_as_mappable :distance_column_name =&gt; 'dist', 
-                   :default_units =&gt; :kms, 
-                   :default_formula =&gt; :flat, 
-                   :lat_column_name =&gt; 'latitude', 
-                   :lng_column_name =&gt; 'longitude'
-                   
-  def to_s
-    &quot;lat: #{latitude} lng: #{longitude} dist: #{dist}&quot;
-  end
-end
-
-# Used by :through
-class MockAddress &lt; ActiveRecord::Base #:nodoc: all
-  belongs_to :addressable, :polymorphic =&gt; true
-  acts_as_mappable
-end
-
-# Uses :through
-class MockOrganization &lt; ActiveRecord::Base #:nodoc: all
-  has_one :mock_address, :as =&gt; :addressable
-  acts_as_mappable :through =&gt; :mock_address
-end
-
-# Uses :through =&gt; {}
-class MockHouse &lt; ActiveRecord::Base
-  acts_as_mappable
-end
-
-class MockFamily &lt; ActiveRecord::Base
-  belongs_to :mock_house
-end
-
-class MockPerson &lt; ActiveRecord::Base
-  belongs_to :mock_family
-  acts_as_mappable :through =&gt; { :mock_family =&gt; :mock_house }
-end
 
-class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
-    
-  LOCATION_A_IP = &quot;217.10.83.5&quot;  
-    
-  self.fixture_path = File.dirname(__FILE__) + '/fixtures'  
-  self.use_transactional_fixtures = true
-  self.use_instantiated_fixtures  = false
-  self.pre_loaded_fixtures = true
-  fixtures :all
+Geokit::Geocoders::provider_order = [:google, :us]
 
+class ActsAsMappableTest &lt; GeokitTestCase
+  
+  LOCATION_A_IP = &quot;217.10.83.5&quot;
+  
   def setup
     @location_a = GeoKit::GeoLoc.new
     @location_a.lat = 32.918593
@@ -88,7 +25,7 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     @custom_loc_a = custom_locations(:a)
     @loc_e = locations(:e)
     @custom_loc_e = custom_locations(:e)
-
+  
     @barnes_and_noble = mock_organizations(:barnes_and_noble)
     @address = mock_addresses(:address_barnes_and_noble)
   end
@@ -192,7 +129,7 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     locations = Location.count(:origin =&gt; @loc_a, :conditions =&gt; [&quot;distance &lt; ? and city = ?&quot;, 5, 'Coppell'])
     assert_equal 2, locations
   end
-
+  
   def test_find_beyond
     locations = Location.find_beyond(3.95, :origin =&gt; @loc_a)
     assert_equal 1, locations.size    
@@ -227,7 +164,7 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     locations = Location.count(:origin =&gt; @loc_a, :range =&gt; 0..10, :conditions =&gt; [&quot;city = ?&quot;, 'Coppell'])
     assert_equal 2, locations
   end
-
+  
   def test_find_range_with_token_with_hash_conditions
     locations = Location.find(:all, :origin =&gt; @loc_a, :range =&gt; 0..10, :conditions =&gt; {:city =&gt; 'Coppell'})
     assert_equal 2, locations.size
@@ -463,17 +400,17 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     locations = Location.count(:origin =&gt;[@loc_a.lat,@loc_a.lng], :conditions =&gt; &quot;distance &lt; 3.97&quot;)
     assert_equal 5, locations
   end
-
-
+  
+  
   # Bounding box tests
-
+  
   def test_find_within_bounds
     locations = Location.find_within_bounds([@sw,@ne])
     assert_equal 2, locations.size
     locations = Location.count_within_bounds([@sw,@ne])
     assert_equal 2, locations
   end
-
+  
   def test_find_within_bounds_ordered_by_distance
     locations = Location.find_within_bounds([@sw,@ne], :origin=&gt;@bounds_center, :order=&gt;'distance asc')
     assert_equal locations[0], locations(:d)
@@ -486,22 +423,22 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     locations = Location.count(:bounds=&gt;[@sw,@ne])
     assert_equal 2, locations  
   end
-
+  
   def test_find_within_bounds_with_string_conditions
     locations = Location.find(:all, :bounds=&gt;[@sw,@ne], :conditions=&gt;&quot;id !=#{locations(:a).id}&quot;)
     assert_equal 1, locations.size
   end
-
+  
   def test_find_within_bounds_with_array_conditions
     locations = Location.find(:all, :bounds=&gt;[@sw,@ne], :conditions=&gt;[&quot;id != ?&quot;, locations(:a).id])
     assert_equal 1, locations.size
   end
-
+  
   def test_find_within_bounds_with_hash_conditions
     locations = Location.find(:all, :bounds=&gt;[@sw,@ne], :conditions=&gt;{:id =&gt; locations(:a).id})
     assert_equal 1, locations.size
   end
-
+  
   def test_auto_geocode
     GeoKit::Geocoders::MultiGeocoder.expects(:geocode).with(&quot;Irving, TX&quot;).returns(@location_a)
     store=Store.new(:address=&gt;'Irving, TX')
@@ -510,7 +447,7 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     assert_equal store.lng,@location_a.lng
     assert_equal 0, store.errors.size
   end
-
+  
   def test_auto_geocode_failure
     GeoKit::Geocoders::MultiGeocoder.expects(:geocode).with(&quot;BOGUS&quot;).returns(GeoKit::GeoLoc.new)
     store=Store.new(:address=&gt;'BOGUS')
@@ -527,7 +464,7 @@ class ActsAsMappableTest &lt; ActiveSupport::TestCase #:nodoc: all
     organizations = MockOrganization.count(:origin =&gt; @location_a, :conditions =&gt; &quot;distance &lt; 3.97&quot;)
     assert_equal 1, organizations
   end
-
+  
   def test_find_with_through_with_hash
     people = MockPerson.find(:all, :origin =&gt; @location_a, :order =&gt; 'distance ASC')
     assert_equal 2, people.size</diff>
      <filename>test/acts_as_mappable_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,14 @@
-mysql:
-  adapter: mysql
+baes: &amp;base
   host: localhost
   username: root
-  password:
+  password: 
+  
+mysql:
+  adapter: mysql
   database: geokit_plugin_test
+  &lt;&lt;: *base
+
 postgresql:
   adapter: postgresql
-  host: localhost
-  username: root
-  password: 
-  database: geokit_plugin_test
\ No newline at end of file
+  database: geokit_plugin_test
+  &lt;&lt;: *base
\ No newline at end of file</diff>
      <filename>test/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,8 @@
-require ENV['environment'] || File.join(File.dirname(__FILE__), '../../../../config/environment')
-require 'action_controller/test_process'
-require 'test/unit'
-require 'rubygems'
-require 'mocha'
+require 'test_helper'
 
+ActionController::Routing::Routes.draw do |map|
+  map.connect ':controller/:action/:id'
+end
 
 class LocationAwareController &lt; ActionController::Base #:nodoc: all
   geocode_ip_address
@@ -22,7 +21,8 @@ class LocationAwareController #:nodoc: all
   def rescue_action(e) raise e end; 
 end
 
-class IpGeocodeLookupTest &lt; Test::Unit::TestCase #:nodoc: all
+class IpGeocodeLookupTest &lt; ActionController::TestCase
+  tests LocationAwareController
   
   def setup
     @success = GeoKit::GeoLoc.new
@@ -38,10 +38,6 @@ class IpGeocodeLookupTest &lt; Test::Unit::TestCase #:nodoc: all
     @failure.provider = &quot;hostip&quot;
     @failure.city = &quot;(Private Address)&quot;
     @failure.success = false
-    
-    @controller = LocationAwareController.new
-    @request = ActionController::TestRequest.new
-    @response = ActionController::TestResponse.new
   end
 
   def test_no_location_in_cookie_or_session</diff>
      <filename>test/ip_geocode_lookup_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,23 @@
-ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
-require &quot;test/unit&quot;
-require &quot;rubygems&quot;
-#require File.dirname(__FILE__) + '/../init'
-require 'geokit'
-
-plugin_test_dir = File.dirname(__FILE__)
+require 'rubygems'
+require 'mocha'
 
-# Load the Rails environment
-require ENV['environment'] || File.join(plugin_test_dir, '../../../../config/environment')
-require 'test_help'
-#require 'active_record/fixtures'
-databases = YAML::load(IO.read(plugin_test_dir + '/database.yml'))
-ActiveRecord::Base.logger = Logger.new(plugin_test_dir + &quot;/debug.log&quot;)
+require 'boot'
 
-# A specific database can be used by setting the DB environment variable
-ActiveRecord::Base.establish_connection(databases[ENV['DB'] || 'mysql'])
+require 'geokit'
+require 'geokit-rails'
 
-# Load the test schema into the database
-load(File.join(plugin_test_dir, 'schema.rb'))
 
-# Load fixtures from the plugin
-#Test::Unit::TestCase.fixture_path = File.join(plugin_test_dir, 'fixtures/')
+class GeokitTestCase &lt; ActiveSupport::TestCase
+  begin
+    include ActiveRecord::TestFixtures
+  rescue NameError
+    puts &quot;You appear to be using a pre-2.3 version of Rails. No need to include ActiveRecord::TestFixtures.&quot;
+  end
+  
+  self.fixture_path = File.join(File.dirname(__FILE__), 'fixtures')
+  self.use_transactional_fixtures = true
+  self.use_instantiated_fixtures  = false
+  
+  fixtures :all
+  
+end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4c1d998b6a7815808dd3fbf15098e6eb745b1ae7</id>
    </parent>
  </parents>
  <author>
    <name>Brennan Dunn</name>
    <email>me@brennandunn.com</email>
  </author>
  <url>http://github.com/andre/geokit-rails/commit/588f7493cd4eaeb497fefda12c07c92119130624</url>
  <id>588f7493cd4eaeb497fefda12c07c92119130624</id>
  <committed-date>2009-09-29T10:01:08-07:00</committed-date>
  <authored-date>2009-09-29T10:01:08-07:00</authored-date>
  <message>Overhaul the test suite to be independent of a Rails project, along with doing some general cleanup. Controller tests are failing now that I'm using ActionController::TestCase.</message>
  <tree>97aa319d46b881ed6aabde873c75f04618095dbe</tree>
  <committer>
    <name>Brennan Dunn</name>
    <email>me@brennandunn.com</email>
  </committer>
</commit>
