-
-
Save probablykabari/305634 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spec::Runner.configure do |config| | |
config.before do | |
repository do |r| | |
transaction = DataMapper::Transaction.new(r) | |
transaction.begin | |
r.adapter.push_transaction(transaction) | |
end | |
end | |
config.after do | |
repository do |r| | |
adapter = r.adapter | |
while adapter.current_transaction | |
adapter.current_transaction.rollback | |
adapter.pop_transaction | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment