<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/unit_test_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -37,6 +37,8 @@ This turns out to be easy to solve. A migration helper is available (see below)
 
 === Setup ===
 
+---+ Model
+
 Any ActiveRecord class that wants the soft delete functionality should add
 the following line to their class definition:
 
@@ -46,6 +48,8 @@ class SomeModel &lt; ActiveRecord::Base
   ...
 &lt;/pre&gt;
 
+---+ Migration
+
 and setup the deleted table with the following migration:
 
 &lt;pre&gt;
@@ -60,6 +64,33 @@ class AddActsAsSoftDeletable &lt; ActiveRecord::Migration
 end
 &lt;/pre&gt;
 
+Any changes to the original table (such as adding a column) should be reflected in the deleted table. Use the update_columns method:
+
+&lt;pre&gt;
+class AddSkuColumn &lt; ActiveRecord::Migration
+  def self.up
+    add_column 'items', 'sku', :string
+    Item::Deleted.update_columns # will add sku column
+  end
+
+  def self.down
+    remove_column 'items', 'sku'
+    Item::Deleted.update_columns # will remove sku column
+  end
+end
+&lt;/pre&gt;
+
+---+ Unit tests
+
+A model's soft delete capabilities can be unit tests easily by using some provide asserts.
+
+&lt;pre&gt;
+  def test_soft_delete_works
+    # will run the model through a destroy and undestroy while making sure all values were saved
+    assert_model_soft_deletes( items(:radar_detector) )
+  end
+&lt;/pre&gt;
+
 === TODO ===
 
 make undestroying easier when there are lots of related rows to undestroy.</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,2 @@
 require File.join(File.dirname(__FILE__), 'lib', 'acts_as_soft_deletable')
+require File.join(File.dirname(__FILE__), 'lib', 'unit_test_helper.rb')</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,13 @@
 == Creating the test database(s)
 
 The tests can run against several databases. See the related test/connections/#{adapter}/connection.rb file
-for information about expected connection settings.
+for information about expected connection settings. 
+
+The sqlite tests are especially easy to run once the required gems are installed.
 
 == Other Prerequisites
 
-Mocha must be installed.
+The mocha gem must be installed.
 
 == Running with Rake
 </diff>
      <filename>test/RUNNING_UNIT_TESTS</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ require 'active_support'
 require 'active_record'
 require 'active_record/fixtures'
 
-require 'acts_as_soft_deletable'
+require File.join(File.dirname(__FILE__), '..', 'init')
 
 begin
   # pulls from one of test/connections/#{adapter}/connection.rb depending on how rake setup our lib paths
@@ -44,13 +44,4 @@ class SoftDeleteTestCase &lt; Test::Unit::TestCase #:nodoc:
     super
   end
 
-  private
-
-    def assert_models_equal(a, b, message = &quot;models weren't equal&quot;)
-      reject_attrs = %q(deleted_at, updated_at)
-      assert_equal \
-        a.attributes.reject{|k,v| reject_attrs.include? k}, 
-        b.attributes.reject{|k,v| reject_attrs.include? k},
-        message
-    end
 end</diff>
      <filename>test/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ class TestActsAsSoftDeletable &lt; SoftDeleteTestCase
     assert_nil Artist.find_by_name('Chick Corea')
 
     deleted = Artist::Deleted.find_by_name('Chick Corea')
-    assert_models_equal artist, deleted
+    assert_soft_delete_models_are_equal artist, deleted
   end
 
   def test_deleted_model_should_be_able_to_undestroy
@@ -16,7 +16,7 @@ class TestActsAsSoftDeletable &lt; SoftDeleteTestCase
 
     deleted.undestroy!
 
-    assert_models_equal deleted, Artist.find_by_name('Robert Walter')
+    assert_soft_delete_models_are_equal deleted, Artist.find_by_name('Robert Walter')
     assert_nil Artist::Deleted.find_by_name('Robert Walter')
     assert deleted.frozen?
   end
@@ -39,6 +39,10 @@ class TestActsAsSoftDeletable &lt; SoftDeleteTestCase
     end
 
     restored = Decimal.find :first
-    assert_models_equal decimal, restored
+    assert_soft_delete_models_are_equal decimal, restored
+  end
+
+  def test_helper_should_work
+    assert_model_soft_deletes Artist.find_by_name('Chick Corea')
   end
 end</diff>
      <filename>test/test_acts_as_soft_deletable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,8 @@ if ActiveRecord::Base.connection.supports_migrations?
 
       migrate_up(3)
 
-      assert_soft_delete_works
+      t = Thing.create! :title =&gt; 'blah blah', :price =&gt; 123.45, :type =&gt; 'Thing'
+      assert_model_soft_deletes(t)
 
       migrate_down
 
@@ -25,9 +26,8 @@ if ActiveRecord::Base.connection.supports_migrations?
 
       migrate_up(4)
 
-      #t = Thing.create! :title =&gt; 'blah blah', :price =&gt; 123.45, :type =&gt; 'Thing'
-      #new_assert_soft_delete_works(t)
-      assert_soft_delete_works
+      t = Thing.create! :title =&gt; 'blah blah', :price =&gt; 123.45, :type =&gt; 'Thing'
+      assert_model_soft_deletes(t)
 
       migrate_down
 
@@ -60,7 +60,7 @@ if ActiveRecord::Base.connection.supports_migrations?
       end
 
       # takes a saved model and runs assertions testing whether soft deleting is working
-      def new_assert_soft_delete_works(model)
+      def assert_model_soft_deletes(model)
         klass = model.class
         deleted_klass = model.class.deleted_class
 
@@ -72,23 +72,9 @@ if ActiveRecord::Base.connection.supports_migrations?
 
         deleted.undestroy!
 
-        assert_models_equal deleted, klass.find(model.id)
+        assert_soft_delete_models_are_equal deleted, klass.find(model.id)
         assert_raises(ActiveRecord::RecordNotFound) { deleted_klass.find model.id }
       end
 
-      def assert_soft_delete_works
-        t = Thing.create! :title =&gt; 'blah blah', :price =&gt; 123.45, :type =&gt; 'Thing'
-
-        assert_nil Thing::Deleted.find_by_title('blah blah')
-        t.destroy
-
-        assert(deleted = Thing::Deleted.find_by_title('blah blah'))
-        assert_nil Thing.find_by_title('blah blah')
-
-        deleted.undestroy!
-
-        assert_models_equal deleted, Thing.find_by_title('blah blah')
-        assert_nil Thing::Deleted.find_by_title('blah blah')
-      end
   end
 end</diff>
      <filename>test/test_migration.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0bbb6e8cf59630069d4a9e5c48c3377c5e8a0d24</id>
    </parent>
  </parents>
  <author>
    <name>(no author)</name>
    <email>(no author)@bb26965d-a405-0410-8ce8-d62df5cd24e9</email>
  </author>
  <url>http://github.com/ajh/acts_as_soft_deletable/commit/a3a974e428d5afbe2e625d10ad13b46a6c3316ec</url>
  <id>a3a974e428d5afbe2e625d10ad13b46a6c3316ec</id>
  <committed-date>2008-03-13T14:52:16-07:00</committed-date>
  <authored-date>2008-03-13T14:52:16-07:00</authored-date>
  <message>add test helper and use them internally. Update Readme again.

git-svn-id: http://llama/svn/trunk/ruby/acts_as_soft_deletable@238 bb26965d-a405-0410-8ce8-d62df5cd24e9</message>
  <tree>a78953581306e1c1dc8aedaacf26db776da38b08</tree>
  <committer>
    <name>(no author)</name>
    <email>(no author)@bb26965d-a405-0410-8ce8-d62df5cd24e9</email>
  </committer>
</commit>
