Skip to content

Instantly share code, notes, and snippets.

@julik
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
@elijahsmith
Copy link

where do you put this and how do you include it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment