Brian Candler
4/1/2007 7:16:00 PM
On Mon, Apr 02, 2007 at 03:11:16AM +0900, Scott Taylor wrote:
> You will have to require the file of the class you are testing.
He's not testing any external class. He's just writing a skeleton test at
this point, to check he understands how Test::Unit works (a good strategy
IMO)
> Also, I suspect that you aren't testing a class named "Unit".
>
> If you are testing a class named "Array", your class name would be
> "ArrayTest"
It doesn't make the slightest difference. He can call his test class
'Flurble' by all means.
Anyway, who says that a unit test suite has to test only a single class?
Many useful tests under Test::Unit are really integration tests that
exercise a whole load of classes.
> Another point to make: I don't think you have to write an
> "initialize" method at any point.
That's true.
I always found it odd about Test::Unit that you define a 'Class' for your
tests, when presumably only one instance of this class is ever instantiated.
> >UnitTests.new
He doesn't need that either; the test runner finds all the classes of
interest and creates the objects by itself.
Regards,
Brian.