From: "David A. Black" Date: 2005-11-15T01:06:23+09:00 Subject: Re: Putting unit test cases in the code - RDoc & UnitTest Hi -- On Tue, 15 Nov 2005, listrecv@gmail.com wrote: > Hi. I find that the best place to put unit test cases is in the file > for the class being tested itself. This puts everything in the same > place, and also makes examples readily available for someone trying to > understand the code. > > Question 1: Can I do this without having Test::Unit automatically run > the tests, every time the file is require 'd? You can put this at the end of the file: if $0 == __FILE__ # test code here end and then that code will only run if that exact file has been invoked. David -- David A. Black dblack@wobblini.net