From: Jesse Jones Date: 2001-12-20T00:07:10+09:00 Subject: [ruby-talk:28936] Re: Yet Another Unit Test Framework In article <3C1F84D9.71C94118@stud.ntnu.no>, Kent Dahl wrote: > 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". Good point. I'll have to experiment with this a bit and see if I like it better. Thanks for the comments! -- Jesse