Skip to content

Instantly share code, notes, and snippets.

@probablykabari
Created May 10, 2011 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save probablykabari/964844 to your computer and use it in GitHub Desktop.
Save probablykabari/964844 to your computer and use it in GitHub Desktop.
datamapper rspec transaction
config.before(:each) do
repository(:default) do
transaction = DataMapper::Transaction.new(repository)
transaction.begin
repository.adapter.push_transaction(transaction)
end
end
config.after(:each) do
repository(:default).adapter.pop_transaction.rollback
end
@oneamtu
Copy link

oneamtu commented Jul 8, 2016

worked great, thanks!

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