On 20 Sep 2008, at 01:59, Scott Taylor wrote:


There's another approach though that I haven't tried yet.  One of the
guys I work with truncates all the tables in the db before every
example.  He says this runs as fast or faster than transactional
fixtures, and has the added benefit of NOT being in a transaction, which means that if he actually DOES use a transaction in his application code then he can test it very easily. I've not tried it, but it seems like a
cool idea.

We have a few lines of code in our features steps/env.rb that does this

1. patch AR to stash each AR object created in an array
2. in an After do block, call destroy on each of those objects.

We can probably share if anyone would like to see this.

cheers,
Matt
----
http://blog.mattwynne.net
http://songkick.com

In case you wondered: The opinions expressed in this email are my own and do not necessarily reflect the views of any former, current or future employers of mine.



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to