SUnit: Skipping tests?
Markus Gaelli
gaelli at emergent.de
Wed Mar 29 18:06:16 UTC 2006
On Mar 29, 2006, at 7:35 PM, Markus Gaelli wrote:
> On the other hand some philosophers like Wittgenstein or linguists
> like Lakoff would say that there are better and worse examples for
> a given concept - you would not explain the concept of a bird to a
> child with a penguin first...
>
> So how do I make explicit which "animal" I am really interested in
> a test?
>
> Again, just use the block concept.
>
> FooTest >> testBar
> "Our tool is actually able to detect that this is an InverseTest"
>
> "..someSetupCode for blaBla."
> (...)
> self test: [aResult := blaBla bar inverseBar] "All methods called
> in the test block are methods under test"
>
> "some assertions to make this a test and not a mere example"
> self assert: (aResult = blaBla)
Having said all this, I have to retract my arguments vs.
self shouldnt:[bb copyBits] raise: Error.
from my morning mail of course...
If its always Error that I don't expect in my methods under test I
could rewrite
> self test: [aResult := blaBla bar inverseBar] "All methods called
> in the test block are methods under test"
from above easily into
self shouldntRaiseError: [aResult := blaBla bar inverseBar] "All
methods called in the test block are methods under test"
;-)
The only difference to Andreas' solution would be that I would
bracket the methods under test like this, even if there are some
assertions down below in the code.
Cheers,
Markus
More information about the Squeak-dev
mailing list
|