<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,3 +4,4 @@ coverage
 .svn/
 pkg
 *.swp
+tags</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -65,8 +65,47 @@ module Shoulda # :nodoc:
       end
     end
 
+    # Macro that creates a test asserting that a record of the given class was
+    # created.
+    #
+    # Example:
+    #
+    #   context &quot;creating a post&quot; do
+    #     setup { Post.create(post_attributes) }
+    #     should_create :post
+    #   end
+    def should_create(class_name)
+      should_change_record_count_of(class_name, 1, 'create')
+    end
+
+    # Macro that creates a test asserting that a record of the given class was
+    # destroyed.
+    #
+    # Example:
+    #
+    #   context &quot;destroying a post&quot; do
+    #     setup { Post.first.destroy }
+    #     should_destroy :post
+    #   end
+    def should_destroy(class_name)
+      should_change_record_count_of(class_name, -1, 'destroy')
+    end
+
     private
 
+    def should_change_record_count_of(class_name, amount, action) # :nodoc:
+      klass = class_name.to_s.camelize.constantize
+      before = lambda do
+        @_before_change_record_count = klass.count
+      end
+      human_name = class_name.to_s.humanize.downcase
+      should &quot;#{action} a #{human_name}&quot;, :before =&gt; before do
+        assert_equal @_before_change_record_count + amount,
+                     klass.count,
+                     &quot;Expected to #{action} a #{human_name}&quot;
+      end
+    end
+
     include Shoulda::Private
   end
 end</diff>
      <filename>lib/shoulda/macros.rb</filename>
    </modified>
    <modified>
      <diff>@@ -238,4 +238,68 @@ class HelpersTest &lt; Test::Unit::TestCase # :nodoc:
       end
     end
   end
+
+  context &quot;given one treat exists and one post exists&quot; do
+    setup do
+      Treat.create!
+      Post.create!(:title =&gt; 'title', :body =&gt; 'body', :user_id =&gt; 1)
+    end
+
+    teardown do
+      Treat.delete_all
+      Post.delete_all
+    end
+
+    context &quot;creating a treat&quot; do
+      setup do
+        Treat.create!
+      end
+
+      should_create :treat
+      should_fail do
+        should_create :post
+      end
+    end
+
+    context &quot;creating a treat and a post&quot; do
+      setup do
+        Treat.create!
+        Post.create!(:title =&gt; 'title 2', :body =&gt; 'body', :user_id =&gt; 1)
+      end
+
+      should_create :treat
+      should_create :post
+    end
+
+    context &quot;destroying a treat&quot; do
+      setup do
+        Treat.first.destroy
+      end
+
+      should_destroy :treat
+      should_fail do
+        should_destroy :post
+      end
+    end
+
+    context &quot;destroying a treat and a post&quot; do
+      setup do
+        Treat.first.destroy
+        Post.first.destroy
+      end
+
+      should_destroy :treat
+      should_destroy :post
+    end
+
+    context &quot;doing nothing&quot; do
+      should_fail do
+        should_create :treat
+      end
+
+      should_fail do
+        should_destroy :treat
+      end
+    end
+  end
 end</diff>
      <filename>test/other/helpers_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>712a02615a2d120a46262b845d7cb338d9203c5e</id>
    </parent>
  </parents>
  <author>
    <name>Joe Ferris</name>
    <email>joe.r.ferris@gmail.com</email>
  </author>
  <url>http://github.com/rmm5t/shoulda/commit/673ffa66974502e1f12c70fab32a19dc91d365e1</url>
  <id>673ffa66974502e1f12c70fab32a19dc91d365e1</id>
  <committed-date>2009-05-05T18:16:12-07:00</committed-date>
  <authored-date>2009-05-05T18:16:12-07:00</authored-date>
  <message>Added should_create and should_destroy [#190 state:resolved]</message>
  <tree>3c3e054e6f0d9902901b5b98dff4515e5527f233</tree>
  <committer>
    <name>Joe Ferris</name>
    <email>joe.r.ferris@gmail.com</email>
  </committer>
</commit>
