RSpec provides an around(:each) hook but no around(:all) hook. I realized recently that you can build an around hook out of separate before/after hooks using fibers, and decided to blog about it [1], using an around(:all) hook as the example. Some of you may find it interesting or even potentially useful. There's a microgem available as a gist [2] as well. Note that I'll probably never use this gem and the :all hooks may be going away at some point [3], so use at your own risk. It's more of a proof-of-concept and a fun exercise than anything else.
Myron [1] http://myronmars.to/n/dev-blog/2012/03/building-an-around-hook-using-fibers [2] https://gist.github.com/2005175 [3] https://github.com/rspec/rspec-core/issues/573
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users