2

If we use setup method, that method is executed before each test. I want to write a method, that will be executed once for a class.

In RSpec, there is a method called before :all which will allow me to do so. But I'm looking if there is equivalent method of before :all in Test::Unit

Alpha
  • 13,320
  • 27
  • 96
  • 163
  • Hope this helps http://stackoverflow.com/questions/7729444/with-testunit-how-can-i-run-a-bit-of-code-before-all-tests-but-not-each-test – vigneshre Sep 20 '13 at 03:56
  • Thanks vigneshre! Actually, I'm looking if there is built-in method. If there is no such method, then I'll have to write my own code to handle this situation. – Alpha Sep 20 '13 at 05:14
  • `before :all` is a code smell - it means your tests are no longer running in isolation because they're sharing a setup state. – sevenseacat Sep 21 '13 at 09:42

0 Answers0