On 2014-02-25, at 17:04, [email protected] wrote:

> I'd like to better understand the semantics of "expected failures" in 
> TestRunner.  It seems to me that if you want to ensure that a certain 
> operation fails, in a test you'd wrap it as follows...
> 
>   shouldFailed=false.
>   [ self operationThatShouldFail ] on: Error do: [ shouldFailed := true ].
>   self assert: shouldFailed.

I prefer:

        self should: [ self operationThatShouldFail ] raise: ASpecificError

Otherwise you can just run the code itself:

        self operationThatShouldFail

the test framework will take care of it and mark the test correctly as a 
failure.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to