<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/database.yml</filename>
    </added>
    <added>
      <filename>test/database.yml.mysql</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'rubygems'
 require 'echoe'
 
+#gem 'rails', '=2.0.2'
+
 require File.dirname(__FILE__) &lt;&lt; &quot;/lib/data_fabric/version&quot;
 
 Echoe.new 'data_fabric' do |p|
@@ -33,7 +35,7 @@ def load_database_yml
   if !File.exist?(filename)
     STDERR.puts &quot;\n*** ERROR ***:\n&quot; &lt;&lt;
       &quot;You must have a 'test/database.yml' file in order to create the test database. &quot; &lt;&lt;
-      &quot;An example is provided in 'test/database.yml.example'.\n\n&quot;
+      &quot;An example is provided in 'test/database.yml.mysql'.\n\n&quot;
     exit 1
   end
   YAML::load(ERB.new(IO.read(filename)).result)
@@ -42,12 +44,12 @@ end
 def setup_connection
   require 'active_record'
   ActiveRecord::Base.configurations = load_database_yml
-  ActiveRecord::Base.establish_connection('fiveruns_city_austin_test_master')
   ActiveRecord::Base.logger = Logger.new(STDOUT)
   ActiveRecord::Base.logger.level = Logger::DEBUG
 end
 
 def using_connection(database_identifier, &amp;block)
+  ActiveRecord::Base.establish_connection(database_identifier)
   ActiveRecord::Base.connection.instance_eval(&amp;block)
 end
 
@@ -56,18 +58,30 @@ def setup(create = false)
   
   ActiveRecord::Base.configurations.each_pair do |identifier, config|
     using_connection(identifier) do
-      db_name = config['database']
-      if create
-        execute &quot;drop database if exists #{db_name}&quot;
-        execute &quot;create database #{db_name}&quot;
-      end
-      execute &quot;use #{db_name}&quot;
-      execute &quot;drop table if exists the_whole_burritos&quot;
-      execute &quot;drop table if exists enchiladas&quot;
-      execute &quot;create table enchiladas (id integer not null auto_increment, name varchar(30) not null, primary key(id))&quot;
-      execute &quot;insert into enchiladas (id, name) values (1, '#{db_name}')&quot;
-      execute &quot;create table the_whole_burritos (id integer not null auto_increment, name varchar(30) not null, primary key(id))&quot;
-      execute &quot;insert into the_whole_burritos (id, name) values (1, '#{db_name}')&quot;
+      send(&quot;create_#{config['adapter']}&quot;, create, config['database'])
     end  
   end
 end
+
+def create_sqlite3(create, db_name)
+  execute &quot;drop table if exists the_whole_burritos&quot;
+  execute &quot;drop table if exists enchiladas&quot;
+  execute &quot;create table enchiladas (id integer not null primary key, name varchar(30) not null)&quot;
+  execute &quot;insert into enchiladas (id, name) values (1, '#{db_name}')&quot;
+  execute &quot;create table the_whole_burritos (id integer not null primary key, name varchar(30) not null)&quot;
+  execute &quot;insert into the_whole_burritos (id, name) values (1, '#{db_name}')&quot;
+end
+
+def create_mysql(create, db_name)
+  if create
+    execute &quot;drop database if exists #{db_name}&quot;
+    execute &quot;create database #{db_name}&quot;
+  end
+  execute &quot;use #{db_name}&quot;
+  execute &quot;drop table if exists the_whole_burritos&quot;
+  execute &quot;drop table if exists enchiladas&quot;
+  execute &quot;create table enchiladas (id integer not null auto_increment, name varchar(30) not null, primary key(id))&quot;
+  execute &quot;insert into enchiladas (id, name) values (1, '#{db_name}')&quot;
+  execute &quot;create table the_whole_burritos (id integer not null auto_increment, name varchar(30) not null, primary key(id))&quot;
+  execute &quot;insert into the_whole_burritos (id, name) values (1, '#{db_name}')&quot;
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,10 @@ data_fabric has two layers of tests: unit tests and integration tests.
 == Running the Unit Tests
 
 The unit tests test both with and without an actual database.  test/database_test.rb
-tests against a MySQL database.  The other unit tests mock AR so no actual database is 
-required.  You must customize test/database.yml to point to your MySQL database.  
-&quot;rake pretest&quot; will set up MySQL to run the tests but you will need to customize
-the connection settings in the Rakefile pretest task.
+tests against a database.  The other unit tests mock AR so no actual database is 
+required.  You can use the standard test/database.yml which tests against SQLite3
+or customize the provided test/database.yml.mysql.  The &quot;rake create_db&quot; task will
+set up the necessary databases and tables.
 
 
 == Running the Integration Tests
@@ -27,6 +27,4 @@ then be able to run the example application's tests.
 
 == Submitting Bugs
 
-If you think you've found a problem with data_fabric, please write a unit or integration test
-which reproduces the problem.  This should make tracking down and fixing the bug relatively
-easy and provides a regression test for future releases.
+If you think you've found a problem with data_fabric, contact me at mperham AT gmail.com.</diff>
      <filename>TESTING.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,15 @@ require File.join(File.dirname(__FILE__), 'test_helper')
 require 'flexmock/test_unit'
 
 class PrefixModel &lt; ActiveRecord::Base
-  connection_topology :prefix =&gt; 'prefix'
+  data_fabric :prefix =&gt; 'prefix'
 end
 
 class ShardModel &lt; ActiveRecord::Base
-  connection_topology :shard_by =&gt; :city
+  data_fabric :shard_by =&gt; :city
 end
 
 class TheWholeEnchilada &lt; ActiveRecord::Base
-  connection_topology :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
+  data_fabric :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
 end
 
 class AdapterMock &lt; ActiveRecord::ConnectionAdapters::AbstractAdapter
@@ -43,7 +43,7 @@ end
 class ConnectionTest &lt; Test::Unit::TestCase
 
   def test_should_install_into_arbase
-    assert PrefixModel.methods.include?('connection_topology')
+    assert PrefixModel.methods.include?('data_fabric')
   end
   
   def test_prefix_connection_name</diff>
      <filename>test/connection_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'flexmock/test_unit'
 require 'erb'
 
 class TheWholeBurrito &lt; ActiveRecord::Base
-  connection_topology :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
+  data_fabric :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
 end
 
 class DatabaseTest &lt; Test::Unit::TestCase
@@ -18,11 +18,11 @@ class DatabaseTest &lt; Test::Unit::TestCase
 
       # Should use the slave
       burrito = TheWholeBurrito.find(1)
-      assert_equal 'vr_dallas_slave', burrito.name
+      assert_match 'vr_dallas_slave', burrito.name
       
       # Should use the master
       burrito.reload
-      assert_equal 'vr_dallas_master', burrito.name
+      assert_match 'vr_dallas_master', burrito.name
 
       # ...but immediately set it back to default to the slave
       assert_equal 'fiveruns_city_dallas_test_slave', TheWholeBurrito.connection.connection_name
@@ -30,7 +30,7 @@ class DatabaseTest &lt; Test::Unit::TestCase
       # Should use the master
       TheWholeBurrito.transaction do
         burrito = TheWholeBurrito.find(1)
-        assert_equal 'vr_dallas_master', burrito.name
+        assert_match 'vr_dallas_master', burrito.name
         burrito.save!
       end
     end</diff>
      <filename>test/database_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ class ThreadTest &lt; Test::Unit::TestCase
         class ThreadedEnchilada &lt; ActiveRecord::Base
           self.allow_concurrency = true
           set_table_name :enchiladas
-          connection_topology :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
+          data_fabric :prefix =&gt; 'fiveruns', :replicated =&gt; true, :shard_by =&gt; :city
         end
       }
     end</diff>
      <filename>test/thread_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>.gitignore</filename>
    </removed>
    <removed>
      <filename>test/database.yml.example</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>01a675c5e5dcf9991ce9c51468cd9e2ea8cdd9e9</id>
    </parent>
  </parents>
  <author>
    <name>Mike Perham</name>
    <email>mperham@gmail.com</email>
  </author>
  <url>http://github.com/fiveruns/data_fabric/commit/64b7cc9b7d24b2bdb829d925411f21701712c35f</url>
  <id>64b7cc9b7d24b2bdb829d925411f21701712c35f</id>
  <committed-date>2008-11-22T12:46:15-08:00</committed-date>
  <authored-date>2008-11-22T12:46:15-08:00</authored-date>
  <message>Support testing in sqlite by default, rather than forcing the user
to configure a database.yml.</message>
  <tree>2b3242ad30aa7a624f35ba07b12c34544ecc7767</tree>
  <committer>
    <name>Mike Perham</name>
    <email>mperham@gmail.com</email>
  </committer>
</commit>
