Skip to content

Instantly share code, notes, and snippets.

@snusnu
Created April 14, 2010 01:29
Show Gist options
  • Save snusnu/365345 to your computer and use it in GitHub Desktop.
Save snusnu/365345 to your computer and use it in GitHub Desktop.
require File.expand_path(File.join(File.dirname(__FILE__), '../test_helper'))
class MyProjectSpecifcUnitTest < MiniTest::Unit::TestCase
def setup
repository(:default) do |repository|
transaction = DataMapper::Transaction.new(repository)
transaction.begin
repository.adapter.push_transaction(transaction)
end
end
def teardown
repository(:default).adapter.pop_transaction.rollback
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment