From: Jim Weirich Date: 2003-06-03T12:16:50+09:00 Subject: Re: Unit Testing Style On Mon, 2003-06-02 at 22:15, Jim Freeze wrote: > On Tuesday, 3 June 2003 at 10:30:00 +0900, Jim Weirich wrote: > > [...] (usually a separate Rake/Make target). [...] > > So Jim, do you have a short example of using rake to > manage unit tests? > I am thinking about moving from make to rake so my tests > will be environment independent (at least it will be easier > to install rake than make). I was wondering if anyone would catch the Rake reference. A dirt simple example follows. Assume all of your unit tests are in a directory named "test" and that your source code is in a directory named "lib". task :test do # Run the Unit Tests Sys.ruby %{-Ilib -Itest } + %{-e 'Dir["test/test*.rb"].each { |fn| require fn }'} end Truthfully, I'm still learning to use Rake effectively. I've been limited by Make for so long, it is taking me a while to see some of the possibilities. For example, I'm playing around with a Builder object that is knowledgable about how a, for example, Ruby project is built. All you do is specify a few special directories or actions and the Builder will construct the make targets for you programmatically. I'm watching the discussion on "standard" project directories closely, because if we can standardize the directory structure, then more knowledge can be moved into the Builder. -- -- Jim Weirich jweirich@one.net http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)