On Mar 27, 2006, at 1:23 PM, Bert Freudenberg wrote:
So the circle is closing... exceptions and preconditions again! ;-) So Andreas, want to introduce some ResourceNotAvailable and ToDo exceptions ;-) , or do we get away without them and just throw a PreconditionError that I was suggesting in an earlier thread?
It's all about communicating the test writer's intent to the test runner. And I think I'd prefer "x tests, y passed, z skipped" as Andreas suggested.
Right. I still fail to see why this wouldn't be possible using preconditions and basically putting all tests into the skipped section where the precondition fails.
As said in the previous mail ToDo's could be easily figured by just sticking to the convention not to even start the method under test, which is a good idea in that case anyhow. As a nice effect one would not even have to touch the tests later when the method under test gets implemented.
However, you wouldn't get the "unexpected success" mentioned in the link above.
Hmmm, right! Maybe these to-do tests should not be treated by using failed preconditions but by some idiom like:
FooTest >> testBar
self should: [Foo new bar] stillRaiseButIIDoPromiseToFitxItReallySoonNowTM: Error TestRunner could be tweaked so that failing tests sending above message - or a shorter one ;-) - land in a special section, which would be "not yet implemented" / "unexpected success" respectively.
Just trying to keep the number of concepts small.
Cheers,
Markus