From: Kent Dahl Date: 2001-12-19T23:47:00+09:00 Subject: [ruby-talk:28920] Re: Yet Another Unit Test Framework Jesse Jones wrote: > Most tests are fundamentally pretty simple: you create one or more > objects, call some methods, and verify that the object state is what > you expected. There's no need to create a whole new class to do this, a > class method is more than adequate. But the class method has a much larger definition signature in Ruby, which I don't like. Thou tests are simple, I do use classes to structure them. I found it very "wierd" to have them in a class called UnitTest as class methods. You also end up writing this kind of "scope" into the test method name: test_String_substr This makes my backhead scream for a TestString class. If I write ten tests for additional String methods, I think I both save character-strokes and increase readability if I do "class TestString < RUnit::TestCase" reducing the method definition from "def UnitTest.test_String_substr" to "def test_substr". > I don't understand this one. I am using reflection to find the unit > test methods. That's how UnitTest::doTest figures out which methods to > call. Sorry, that was a brain-fart on my part. The name arugment to UnitTest::doRunTest had me confused. I only glanced very quickly :-) -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/