On Wed, Jan 14, 2009 at 1:27 AM, Greg Hauptmann <[email protected]> wrote: > Hi, > > Just wondering, can one test manual transactions in Rspec/UnitTest noting > the testing framework wraps its DB work in a transaction & mysql doesn't > allow nested transactions?
Wrapping code examples (in rspec) or test methods (in t/u) in a transaction is the default behavior, but is easily turned off with config.transactional_fixtures = false. The name transactional_fixtures is a bit misleading because its really about wrapping each method in a transaction whether you're using fixtures or not. If you do turn this off, however, you'll want some code to truncate the DB after each example (after(:each) in rspec, teardown in test/unit) to avoid leaking state across examples. HTH, David > > -- > Greg > http://blog.gregnet.org/ > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

