Module | Mack::Testing::DataMapperHelpers |
In: |
lib/mack-data_mapper/test_extensions.rb
|
# File lib/mack-data_mapper/test_extensions.rb, line 21 21: def rollback_transaction 22: begin 23: Mack::Testing::DmTestTransactionWrapper.transaction do 24: # DataMapper::Transaction.new.commit do 25: yield if block_given? 26: raise "Rollback!" 27: end 28: rescue => ex 29: # we need to do this so we can throw up actual errors! 30: unless ex.to_s == "Rollback!" 31: raise ex 32: end 33: end 34: end