Created
February 16, 2010 16:11
-
-
Save snusnu/305630 to your computer and use it in GitHub Desktop.
This file contains hidden or 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