From: Hugh Sasse Staff Elec Eng Date: 2003-01-17T02:28:01+09:00 Subject: Re: Unit Testing in dynamic environments On Fri, 17 Jan 2003, Travis Whitton wrote: > I'm just starting to get into unit testing, and I can already see how powerful > a tool it can be to preemptively find bugs in my programs; however, a good > portion of the classes I write revolve around databases and CGI. A lot of the [...] > > class DB [...] > def lims_connect > @lims = DBI.connect("DBI:Mysql:somedb", "someuser", "somepass") > @lims.connected? > end There is an idea called Mock Objects, where your object pretends to be the database, and give stable results. http://www.rubygarden.org/ruby?Mock_Object has info on this. Hugh