From: David Roberts Date: 2006-11-22T03:08:36+09:00 Subject: Re: Ruby unit testing Chris Gallagher wrote: > Hi, > > I have a ruby script that I would like to apply unit testing against but > Ive never actually created any previously and the documentation is not > bad but im struggling to apply it to my own code. > > Could someone give a couple of examples of how unit testing might be > applied to the following code just to get me started on it. > > [ sample code removed from this reply - dj ] > > I know that I need to include: > > require 'test/unit' > require '../name_of_code_tested' > > after that though it gets less clear :( > > any ideas? > > cheers. Perhaps ZenTest might be of interest? It will scan your code and sketch out the outline of tests for each of your methods. http://www.zenspider.com/ZSS/Products/ZenTest/ Some other resources include - http://onestepback.org/articles/tdddemo/ http://wiki.rubygarden.org/Ruby/page/show/UsingTestUnit http://grayproductions.net/ruby/first_steps.html -- Posted via http://www.ruby-forum.com/.