title: rollback changes created by minitest unit test
body: <p>I'm writing a test case in Minitest that creates a database entry. After the test is run, all changes that the test did should be rolled back. What is a good way to achieve this?</p>
  
  <pre><code>require 'minitest/autorun'
  require 'rubygems'
  require 'sequel'
  require 'factory_girl'
  
  class TestPostgresqlFunctions &lt; MiniTest::Unit::TestCase
    def test_simple_function
      Factory.find_definitions
      user = FactoryGirl.create(:user)
    end
  end
  </code></pre>
  
  <p>With this code, the created entry will stay in the database. I'm not using Rails or any other framework. The database I'm using is PostgreSQL 9.1.</p>