<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,39 +0,0 @@
-$:.unshift(File.dirname(__FILE__) + '/../../../rails/activesupport/lib')
-$:.unshift(File.dirname(__FILE__) + '/../../../rails/activerecord/lib')
-
-require 'test/unit'
-require 'active_support'
-require 'active_record'
-require 'active_record/fixtures'
-
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-require &quot;#{File.dirname(__FILE__)}/../init&quot;
-
-config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
-ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + &quot;/debug.log&quot;)
-ActiveRecord::Base.configurations = {'test' =&gt; config[ENV['DB'] || 'sqlite3']}
-ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])
-
-load(File.dirname(__FILE__) + &quot;/schema.rb&quot;) if File.exist?(File.dirname(__FILE__) + &quot;/schema.rb&quot;)
-
-class Test::Unit::TestCase #:nodoc:
-  self.fixture_path = File.dirname(__FILE__) + &quot;/fixtures/&quot; 
-  self.use_transactional_fixtures = true
-  self.use_instantiated_fixtures  = false
-  
-  def create_fixtures(*table_names, &amp;block)
-    Fixtures.create_fixtures(File.dirname(__FILE__) + &quot;/fixtures/&quot;, table_names, {}, &amp;block)
-  end
-  
-  def assert_queries(num = 1)
-    $query_count = 0
-    yield
-  ensure
-    assert_equal num, $query_count, &quot;#{$query_count} instead of #{num} queries were executed.&quot;
-  end
-  
-  def assert_no_queries(&amp;block)
-    assert_queries(0, &amp;block)
-  end
-  
-end</diff>
      <filename>test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,123 +1,219 @@
-require File.join(File.dirname(__FILE__), 'abstract_unit')
-require File.join(File.dirname(__FILE__), 'fixtures/mixin')
+require 'test/unit'
+
+require 'rubygems'
+require 'active_record'
+
+$:.unshift File.dirname(__FILE__) + '/../lib'
+require File.dirname(__FILE__) + '/../init'
+
+class Test::Unit::TestCase
+  def assert_queries(num = 1)
+    $query_count = 0
+    yield
+  ensure
+    assert_equal num, $query_count, &quot;#{$query_count} instead of #{num} queries were executed.&quot;
+  end
+
+  def assert_no_queries(&amp;block)
+    assert_queries(0, &amp;block)
+  end
+end
+
+ActiveRecord::Base.establish_connection(:adapter =&gt; &quot;sqlite3&quot;, :dbfile =&gt; &quot;:memory:&quot;)
+
+# AR keeps printing annoying schema statements
+$stdout = StringIO.new
+
+def setup_db
+  ActiveRecord::Base.logger
+  ActiveRecord::Schema.define(:version =&gt; 1) do
+    create_table :mixins do |t|
+      t.column :type, :string
+      t.column :parent_id, :integer
+    end
+  end
+end
+
+def teardown_db
+  ActiveRecord::Base.connection.tables.each do |table|
+    ActiveRecord::Base.connection.drop_table(table)
+  end
+end
+
+class Mixin &lt; ActiveRecord::Base
+end
+
+class TreeMixin &lt; Mixin 
+  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;, :order =&gt; &quot;id&quot;
+end
+
+class TreeMixinWithoutOrder &lt; Mixin
+  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;
+end
+
+class RecursivelyCascadedTreeMixin &lt; Mixin
+  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;
+  has_one :first_child, :class_name =&gt; 'RecursivelyCascadedTreeMixin', :foreign_key =&gt; :parent_id
+end
 
 class TreeTest &lt; Test::Unit::TestCase
-  fixtures :mixins
+  
+  def setup
+    setup_db
+    @root1 = TreeMixin.create!
+    @root_child1 = TreeMixin.create! :parent_id =&gt; @root1.id
+    @child1_child = TreeMixin.create! :parent_id =&gt; @root_child1.id
+    @root_child2 = TreeMixin.create! :parent_id =&gt; @root1.id
+    @root2 = TreeMixin.create!
+    @root3 = TreeMixin.create!
+  end
+
+  def teardown
+    teardown_db
+  end
 
   def test_children
-    assert_equal mixins(:tree_1).children, mixins(:tree_2, :tree_4)
-    assert_equal mixins(:tree_2).children, [mixins(:tree_3)]
-    assert_equal mixins(:tree_3).children, []
-    assert_equal mixins(:tree_4).children, []
+    assert_equal @root1.children, [@root_child1, @root_child2]
+    assert_equal @root_child1.children, [@child1_child]
+    assert_equal @child1_child.children, []
+    assert_equal @root_child2.children, []
   end
 
   def test_parent
-    assert_equal mixins(:tree_2).parent, mixins(:tree_1)
-    assert_equal mixins(:tree_2).parent, mixins(:tree_4).parent
-    assert_nil mixins(:tree_1).parent
+    assert_equal @root_child1.parent, @root1
+    assert_equal @root_child1.parent, @root_child2.parent
+    assert_nil @root1.parent
   end
 
   def test_delete
     assert_equal 6, TreeMixin.count
-    mixins(:tree_1).destroy
+    @root1.destroy
     assert_equal 2, TreeMixin.count
-    mixins(:tree2_1).destroy
-    mixins(:tree3_1).destroy
+    @root2.destroy
+    @root3.destroy
     assert_equal 0, TreeMixin.count
   end
 
   def test_insert
-    @extra = mixins(:tree_1).children.create
+    @extra = @root1.children.create
 
     assert @extra
 
-    assert_equal @extra.parent, mixins(:tree_1)
+    assert_equal @extra.parent, @root1
 
-    assert_equal 3, mixins(:tree_1).children.size
-    assert mixins(:tree_1).children.include?(@extra)
-    assert mixins(:tree_1).children.include?(mixins(:tree_2))
-    assert mixins(:tree_1).children.include?(mixins(:tree_4))
+    assert_equal 3, @root1.children.size
+    assert @root1.children.include?(@extra)
+    assert @root1.children.include?(@root_child1)
+    assert @root1.children.include?(@root_child2)
   end
 
   def test_ancestors
-    assert_equal [], mixins(:tree_1).ancestors
-    assert_equal [mixins(:tree_1)], mixins(:tree_2).ancestors
-    assert_equal mixins(:tree_2, :tree_1), mixins(:tree_3).ancestors
-    assert_equal [mixins(:tree_1)], mixins(:tree_4).ancestors
-    assert_equal [], mixins(:tree2_1).ancestors
-    assert_equal [], mixins(:tree3_1).ancestors
+    assert_equal [], @root1.ancestors
+    assert_equal [@root1], @root_child1.ancestors
+    assert_equal [@root_child1, @root1], @child1_child.ancestors
+    assert_equal [@root1], @root_child2.ancestors
+    assert_equal [], @root2.ancestors
+    assert_equal [], @root3.ancestors
   end
 
   def test_root
-    assert_equal mixins(:tree_1), TreeMixin.root
-    assert_equal mixins(:tree_1), mixins(:tree_1).root
-    assert_equal mixins(:tree_1), mixins(:tree_2).root
-    assert_equal mixins(:tree_1), mixins(:tree_3).root
-    assert_equal mixins(:tree_1), mixins(:tree_4).root
-    assert_equal mixins(:tree2_1), mixins(:tree2_1).root
-    assert_equal mixins(:tree3_1), mixins(:tree3_1).root
+    assert_equal @root1, TreeMixin.root
+    assert_equal @root1, @root1.root
+    assert_equal @root1, @root_child1.root
+    assert_equal @root1, @child1_child.root
+    assert_equal @root1, @root_child2.root
+    assert_equal @root2, @root2.root
+    assert_equal @root3, @root3.root
   end
 
   def test_roots
-    assert_equal mixins(:tree_1, :tree2_1, :tree3_1), TreeMixin.roots
+    assert_equal [@root1, @root2, @root3], TreeMixin.roots
   end
 
   def test_siblings
-    assert_equal mixins(:tree2_1, :tree3_1), mixins(:tree_1).siblings
-    assert_equal [mixins(:tree_4)], mixins(:tree_2).siblings
-    assert_equal [], mixins(:tree_3).siblings
-    assert_equal [mixins(:tree_2)], mixins(:tree_4).siblings
-    assert_equal mixins(:tree_1, :tree3_1), mixins(:tree2_1).siblings
-    assert_equal mixins(:tree_1, :tree2_1), mixins(:tree3_1).siblings
+    assert_equal [@root2, @root3], @root1.siblings
+    assert_equal [@root_child2], @root_child1.siblings
+    assert_equal [], @child1_child.siblings
+    assert_equal [@root_child1], @root_child2.siblings
+    assert_equal [@root1, @root3], @root2.siblings
+    assert_equal [@root1, @root2], @root3.siblings
   end
 
   def test_self_and_siblings
-    assert_equal mixins(:tree_1, :tree2_1, :tree3_1), mixins(:tree_1).self_and_siblings
-    assert_equal mixins(:tree_2, :tree_4), mixins(:tree_2).self_and_siblings
-    assert_equal [mixins(:tree_3)], mixins(:tree_3).self_and_siblings
-    assert_equal mixins(:tree_2, :tree_4), mixins(:tree_4).self_and_siblings
-    assert_equal mixins(:tree_1, :tree2_1, :tree3_1), mixins(:tree2_1).self_and_siblings
-    assert_equal mixins(:tree_1, :tree2_1, :tree3_1), mixins(:tree3_1).self_and_siblings
+    assert_equal [@root1, @root2, @root3], @root1.self_and_siblings
+    assert_equal [@root_child1, @root_child2], @root_child1.self_and_siblings
+    assert_equal [@child1_child], @child1_child.self_and_siblings
+    assert_equal [@root_child1, @root_child2], @root_child2.self_and_siblings
+    assert_equal [@root1, @root2, @root3], @root2.self_and_siblings
+    assert_equal [@root1, @root2, @root3], @root3.self_and_siblings
   end           
 end
 
 class TreeTestWithEagerLoading &lt; Test::Unit::TestCase
-  fixtures :mixins
+  
+  def setup 
+    teardown_db
+    setup_db
+    @root1 = TreeMixin.create!
+    @root_child1 = TreeMixin.create! :parent_id =&gt; @root1.id
+    @child1_child = TreeMixin.create! :parent_id =&gt; @root_child1.id
+    @root_child2 = TreeMixin.create! :parent_id =&gt; @root1.id
+    @root2 = TreeMixin.create!
+    @root3 = TreeMixin.create!
+    
+    @rc1 = RecursivelyCascadedTreeMixin.create!
+    @rc2 = RecursivelyCascadedTreeMixin.create! :parent_id =&gt; @rc1.id 
+    @rc3 = RecursivelyCascadedTreeMixin.create! :parent_id =&gt; @rc2.id
+    @rc4 = RecursivelyCascadedTreeMixin.create! :parent_id =&gt; @rc3.id
+  end
+
+  def teardown
+    teardown_db
+  end
     
   def test_eager_association_loading
-    roots = TreeMixin.find(:all, :include=&gt;&quot;children&quot;, :conditions=&gt;&quot;mixins.parent_id IS NULL&quot;, :order=&gt;&quot;mixins.id&quot;)
-    assert_equal mixins(:tree_1, :tree2_1, :tree3_1), roots
+    roots = TreeMixin.find(:all, :include =&gt; :children, :conditions =&gt; &quot;mixins.parent_id IS NULL&quot;, :order =&gt; &quot;mixins.id&quot;)
+    assert_equal [@root1, @root2, @root3], roots                     
     assert_no_queries do
       assert_equal 2, roots[0].children.size
       assert_equal 0, roots[1].children.size
       assert_equal 0, roots[2].children.size
-    end
+    end   
   end
   
   def test_eager_association_loading_with_recursive_cascading_three_levels_has_many
-    root_node = RecursivelyCascadedTreeMixin.find(:first, :include=&gt;{:children=&gt;{:children=&gt;:children}}, :order =&gt; 'mixins.id')
-    assert_equal mixins(:recursively_cascaded_tree_4), assert_no_queries { root_node.children.first.children.first.children.first }
+    root_node = RecursivelyCascadedTreeMixin.find(:first, :include =&gt; { :children =&gt; { :children =&gt; :children } }, :order =&gt; 'mixins.id')
+    assert_equal @rc4, assert_no_queries { root_node.children.first.children.first.children.first }
   end
-
+  
   def test_eager_association_loading_with_recursive_cascading_three_levels_has_one
-    root_node = RecursivelyCascadedTreeMixin.find(:first, :include=&gt;{:first_child=&gt;{:first_child=&gt;:first_child}}, :order =&gt; 'mixins.id')
-    assert_equal mixins(:recursively_cascaded_tree_4), assert_no_queries { root_node.first_child.first_child.first_child }
+    root_node = RecursivelyCascadedTreeMixin.find(:first, :include =&gt; { :first_child =&gt; { :first_child =&gt; :first_child } }, :order =&gt; 'mixins.id')
+    assert_equal @rc4, assert_no_queries { root_node.first_child.first_child.first_child }
   end
-
+  
   def test_eager_association_loading_with_recursive_cascading_three_levels_belongs_to
-    leaf_node = RecursivelyCascadedTreeMixin.find(:first, :include=&gt;{:parent=&gt;{:parent=&gt;:parent}}, :order =&gt; 'mixins.id DESC')
-    assert_equal mixins(:recursively_cascaded_tree_1), assert_no_queries { leaf_node.parent.parent.parent }
-  end
+    leaf_node = RecursivelyCascadedTreeMixin.find(:first, :include =&gt; { :parent =&gt; { :parent =&gt; :parent } }, :order =&gt; 'mixins.id DESC')
+    assert_equal @rc1, assert_no_queries { leaf_node.parent.parent.parent }
+  end 
 end
 
 class TreeTestWithoutOrder &lt; Test::Unit::TestCase
-  fixtures :mixins
+  
+  def setup                               
+    setup_db
+    @root1 = TreeMixinWithoutOrder.create!
+    @root2 = TreeMixinWithoutOrder.create!
+  end
 
-  def test_root
-    assert mixins(:tree_without_order_1, :tree_without_order_2).include?(TreeMixinWithoutOrder.root)
+  def teardown
+    teardown_db
   end
 
+  def test_root
+    assert [@root1, @root2].include?(TreeMixinWithoutOrder.root)
+  end
+  
   def test_roots
-    assert_equal [], mixins(:tree_without_order_1, :tree_without_order_2) - TreeMixinWithoutOrder.roots
+    assert_equal [], [@root1, @root2] - TreeMixinWithoutOrder.roots
   end
-end
\ No newline at end of file
+end </diff>
      <filename>test/acts_as_tree_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +0,0 @@
-sqlite:
-  :adapter: sqlite
-  :dbfile: acts_as_tree_plugin.sqlite.db
-sqlite3:
-  :adapter: sqlite3
-  :dbfile: acts_as_tree_plugin.sqlite3.db
-postgresql:
-  :adapter: postgresql
-  :username: postgres
-  :password: postgres
-  :database: acts_as_tree_plugin_test
-  :min_messages: ERROR
-mysql:
-  :adapter: mysql
-  :host: localhost
-  :username: rails
-  :password:
-  :database: acts_as_tree_plugin_test</diff>
      <filename>test/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +0,0 @@
-class Mixin &lt; ActiveRecord::Base
-end
-
-class TreeMixin &lt; Mixin 
-  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;, :order =&gt; &quot;id&quot;
-end
-
-class TreeMixinWithoutOrder &lt; Mixin
-  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;
-end
-
-class RecursivelyCascadedTreeMixin &lt; Mixin
-  acts_as_tree :foreign_key =&gt; &quot;parent_id&quot;
-  has_one :first_child, :class_name =&gt; 'RecursivelyCascadedTreeMixin', :foreign_key =&gt; :parent_id
-end</diff>
      <filename>test/fixtures/mixin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,59 +0,0 @@
-tree_1:
-  id: 1001
-  type: TreeMixin
-  parent_id:
-  
-tree_2:
-  id: 1002
-  type: TreeMixin
-  parent_id: 1001
-
-tree_3:
-  id: 1003
-  type: TreeMixin  
-  parent_id: 1002
-
-tree_4:
-  id: 1004
-  type: TreeMixin  
-  parent_id: 1001
-
-tree2_1:
-  id: 1005
-  type: TreeMixin
-  parent_id:
-
-tree3_1:
-  id: 1006
-  type: TreeMixin
-  parent_id:
-
-tree_without_order_1:
-  id: 1101
-  type: TreeMixinWithoutOrder
-  parent_id:
-
-tree_without_order_2:
-  id: 1100
-  type: TreeMixinWithoutOrder
-  parent_id:
-
-recursively_cascaded_tree_1:
-  id: 5005
-  type: RecursivelyCascadedTreeMixin
-  parent_id:
-
-recursively_cascaded_tree_2:
-  id: 5006
-  type: RecursivelyCascadedTreeMixin
-  parent_id: 5005
-
-recursively_cascaded_tree_3:
-  id: 5007
-  type: RecursivelyCascadedTreeMixin
-  parent_id: 5006
-
-recursively_cascaded_tree_4:
-  id: 5008
-  type: RecursivelyCascadedTreeMixin
-  parent_id: 5007
\ No newline at end of file</diff>
      <filename>test/fixtures/mixins.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +0,0 @@
-ActiveRecord::Schema.define(:version =&gt; 1) do
-  create_table :mixins, :force =&gt; true do |t|
-    t.column :parent_id, :integer
-    t.column :pos, :integer        
-    t.column :lft, :integer
-    t.column :rgt, :integer
-    t.column :root_id, :integer
-    t.column :type, :string
-    t.column :created_at, :datetime
-    t.column :updated_at, :datetime    
-  end
-end</diff>
      <filename>test/schema.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f1de7c5f84ec03fc1128cbc3a4a4664288862027</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/acts_as_tree/commit/20988cac158bcf7f7535a3c5dd193165797d719a</url>
  <id>20988cac158bcf7f7535a3c5dd193165797d719a</id>
  <committed-date>2007-09-11T14:33:06-07:00</committed-date>
  <authored-date>2007-09-11T14:33:06-07:00</authored-date>
  <message>Tests needn't run within an app. Closes #9534 [lifofifo]</message>
  <tree>5b38b73d70d9655759266cb9485e02e99a8c602c</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
