Displaying 1 result from an estimated 1 matches for "transactionalspec".
Did you mean:
transactionalspecs
2008 Mar 14
0
Adding before / after blocks to every spec
...le to help me out with a quandry.
I''m trying to write an rspec plugin module for merb that will run all
specs within an ActiveRecord (initially) database transaction - to
give functionality similar to rails transactional fixtures.
Here is the module:
module Merb
module Test
module TransactionalSpecs
def begin_transaction
ActiveRecord::Base.send :increment_open_transactions
ActiveRecord::Base.connection.begin_db_transaction
end
def rollback_transaction
if Thread.current[''open_transactions''] != 0
ActiveRecord::Base.connectio...