Hi, maybe some of you might be interested in the approach I described in the following article [1] suggesting to use nested database transactions to speed up a test suite by creating common records in a before(:all) block rather than recreating them before every single test in the group. To make things simpler, I've also released the rspec_nested_transactions gem [2]. There are examples demonstrating how easy it is with both Sequel and ActiveRecord, provided your database supports either nested transactions or savepoints:
http://rosenfeld.herokuapp.com/en/articles/ruby-rails/2016-08-05-using-rspec-nested-transactions-to-speed-up-tests-touching-the-database https://github.com/rosenfeld/rspec_nested_transactions I hope it could be useful to some of you. Thanks, Myron, for the idea to use Ruby Fibers to implement an around(:all)-like block in RSpec, a few years ago :) That was a really clever trick :) Cheers, Rodrigo. -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/fcd8faf0-a9be-4ed0-b680-f38861feda6f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
