<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,13 +8,6 @@ SET check_function_bodies = false;
 SET client_min_messages = warning;
 SET escape_string_warning = off;
 
---
--- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: -
---
-
-COMMENT ON SCHEMA public IS 'Standard public schema';
-
-
 SET search_path = public, pg_catalog;
 
 --</diff>
      <filename>mack-data_mapper/spec/fixtures/test_test_postgres_schema_structure.sql.fixture</filename>
    </modified>
    <modified>
      <diff>@@ -30,15 +30,60 @@ describe Mack::Database do
     FileUtils.rm_rf(@sqlite3_dump)
   end
   
-  def create_structure_dump_test_db(repis, path)
+  def create_structure_dump_test_db(repis, path, auto_migrate = true)
     DataMapper.setup(repis, path)
     Mack::Database.drop(Mack.env, repis)
     Mack::Database.create(Mack.env, repis)
-    House.auto_migrate!(repis)
-    Cottage.auto_migrate!(repis)
+    if auto_migrate
+      House.auto_migrate!(repis)
+      Cottage.auto_migrate!(repis)
+    end
+  end
+  
+  describe &quot;load_structure&quot; do
+    
+    describe &quot;MySQL&quot; do
+      
+      it &quot;should reconstructe a db from a .sql file&quot; do
+        create_structure_dump_test_db(:test_mysql, &quot;mysql://root@localhost/structure_dump_test&quot;, false)
+        Cottage.should_not be_storage_exists(:test_mysql)
+        House.should_not be_storage_exists(:test_mysql)
+        Mack::Database.load_structure(fixture_location(&quot;test_test_mysql_schema_structure.sql&quot;), Mack.env, :test_mysql)
+        Cottage.should be_storage_exists(:test_mysql)
+        House.should be_storage_exists(:test_mysql)
+      end
+      
+    end
+    
+    describe &quot;Postgres&quot; do
+      
+      it &quot;should reconstructe a db from a .sql file&quot; do
+        create_structure_dump_test_db(:test_postgres, &quot;postgres://ruby:password@localhost/structure_dump_test1&quot;, false)
+        Cottage.should_not be_storage_exists(:test_postgres)
+        House.should_not be_storage_exists(:test_postgres)
+        Mack::Database.load_structure(fixture_location(&quot;test_test_postgres_schema_structure.sql&quot;), Mack.env, :test_postgres)
+        Cottage.should be_storage_exists(:test_postgres)
+        House.should be_storage_exists(:test_postgres)
+      end
+      
+    end
+    
+    describe &quot;SQLite3&quot; do
+      
+      it &quot;should reconstructe a db from a .sql file&quot; do
+        create_structure_dump_test_db(:test_sqlite3, &quot;sqlite3://#{File.join(Mack.root, &quot;db&quot;, &quot;structure_dump_test1.db&quot;)}&quot;, false)
+        Cottage.should_not be_storage_exists(:test_sqlite3)
+        House.should_not be_storage_exists(:test_sqlite3)
+        Mack::Database.load_structure(fixture_location(&quot;test_test_sqlite3_schema_structure.sql&quot;), Mack.env, :test_sqlite3)
+        Cottage.should be_storage_exists(:test_sqlite3)
+        House.should be_storage_exists(:test_sqlite3)
+      end
+      
+    end
+    
   end
   
-  describe &quot;structure_dump&quot; do
+  describe &quot;dump_structure&quot; do
   
     describe &quot;MySQL&quot; do
     
@@ -51,7 +96,7 @@ describe Mack::Database do
       end
     
     end
-  
+      
     describe &quot;Postgres&quot; do
     
       it &quot;should write a .sql that represents the db structure&quot; do
@@ -63,7 +108,7 @@ describe Mack::Database do
       end
     
     end
-  
+      
     describe &quot;SQLite3&quot; do
     
       it &quot;should write a .sql that represents the db structure&quot; do</diff>
      <filename>mack-data_mapper/spec/lib/database_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,5 +17,9 @@ $genosaurus_output_directory = Mack.root
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;mack-paths&quot;, &quot;lib&quot;, &quot;mack-paths&quot;)
 
 def fixture(name)
-  File.read(File.join(File.dirname(__FILE__), &quot;fixtures&quot;, &quot;#{name}.fixture&quot;))
+  File.read(fixture_location(name))
+end
+
+def fixture_location(name)
+  File.join(File.dirname(__FILE__), &quot;fixtures&quot;, &quot;#{name}.fixture&quot;)
 end
\ No newline at end of file</diff>
      <filename>mack-data_mapper/spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5e59164ee092bf48a7d906513e2cbd31a8a6e789</id>
    </parent>
  </parents>
  <author>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </author>
  <url>http://github.com/markbates/mack-more/commit/7a172b53d81204a5afe56ec67926eb5a3e9e362e</url>
  <id>7a172b53d81204a5afe56ec67926eb5a3e9e362e</id>
  <committed-date>2008-08-12T08:00:41-07:00</committed-date>
  <authored-date>2008-08-12T08:00:41-07:00</authored-date>
  <message>Finished tests for mack-data_mapper load_structure. [#67]</message>
  <tree>af5e5cb4d510e839d1e72fe02f1b842da63e44de</tree>
  <committer>
    <name>Mark Bates</name>
    <email>mark@markbates.com</email>
  </committer>
</commit>
