Skip to content

Instantly share code, notes, and snippets.

@julik
julik / transactional.rb
Created November 1, 2011 18:27
Transactional database in Minitest in 7 lines of code
module TransactionalTests
# See minitest doco - use_transactional_fixtures_but_in_ruby
# to use include this into your test case
def run(runner)
test_result = nil
ActiveRecord::Base.transaction { test_result = super; raise ActiveRecord::Rollback }
test_result
end
end