From: Wayne Conrad Date: 2001-10-22T16:02:11+09:00 Subject: [ruby-talk:22938] Re: First steps in unit testing On Sun, 21 October 2001, Massimiliano Mirra wrote: > In other words, 1) uses specific setups, 2) too but with factory > methods, and 3) does it all in the testing method. Prefer #3, because setup and teardown methods are a bit of "OOP spaghetti code," not quite as easy to read as straightforward "start at the beginning and go to the end" code. Also, setup & teardown methods are only really happy when every test looks the same. When you need to add a new test that needs its objects setup a little differently, that handy setup & teardown method will start to get uncomfortable. Factory methods and other helper methods can help to keep duplication in your test to a low roar and still keep the code readable. Wayne Conrad