From: Erik Hollensbe Date: 2006-03-29T08:28:41+09:00 Subject: Re: using unit test On 2006-03-23 17:38:03 -0800, Tim Hunter said: > rtilley wrote: >> What is the most prevalent way of using unit testing in Ruby? Do I >> require 'test/unit' and add test methods to production scripts and then >> comment the testing portions out when not testing? Or, should I develop >> a 'testing' version of the scripts identical to the production versions? >> >> Thanks for any advice. I've got the concept down... just thinking about >> implementation and actively using tests. >> >> Brad > > Put the tests in a separate directory alongside the code. Chapter 12 of > the Pickaxe includes some "best practices" for unit testing Ruby with > Test::Unit. I have a patch which fixes the test functionality in Minero Aoki's setup.rb, which lets you create a test/ directory and run: ruby setup.rb test and it will execute all the tests in the test/ directory. Please email privately if you want the patch (I've already submitted it and recieved no response).