On 15/12/10 11:58 AM, Robert Gravina wrote:
Has anyone seen some examples of rspec + factory girl + setup before
all tests in the wild? I've found Pretty much every rspec + factory
girl example I can find uses the standard before do ... end block for
setup as it's probably fine for most test suites.... maybe I need to
just search the githubs?
A hack for rspec 1.X to provide a before :all hook inside a transaction:
https://gist.github.com/310639
I haven't used this recently, so YMMV
Here's how I've done it with DataMapper (which probably hints at a
better way to do it with ActiveRecord...):
http://rhnh.net/2010/10/06/transactional-before-all-with-rspec-and-datamapper
--
You received this message because you are subscribed to the Google Groups "Ruby or
Rails Oceania" 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/rails-oceania?hl=en.