On Wednesday, 7 May 2014 at 15:07:20 UTC, H. S. Teoh via Digitalmars-d wrote:
On Wed, May 07, 2014 at 04:55:25PM +0200, Jacob Carlborg via Digitalmars-d wrote:
On 07/05/14 16:05, Dicebot wrote:

>Have never liked that fancy description syntax of "smart" >testing
>frameworks.

I hate plain unit test blocks with just a bunch of asserts. It's
impossible to know that's being tested.
[...]

Huh? Isn't that what unittest blocks are about? To verify that certain
assumed conditions are actually true at runtime?

Verbal descriptions can be put in comments, if need be, can't they?

They can. But those descriptions are not included in failing test output. What I think Jacob might be getting to as well is that assertEquals or the more RSpec-like "foo.should equal 3" is more readable than the raw asserts.

The context matters. In some frameworks that means using test names like testThatWhenIDoThisThenTheOtherThingActuallyHappens (which we'd get if we can have named unit tests), RSpec tries to be more readable but in the end it's all about:

1) Documenting what the code is supposed to do
2) Knowing what test failed and what it was testing

Atila

Reply via email to