About exception propagation with ensure:

Lukas Renggli renggli at gmail.com
Fri Oct 28 13:45:35 UTC 2005


> Now if you move the ^newClass into the ensure block as

As I just happen to have worked with Smalllint I know that you should
never put a return into a block being the argument of #ensure:,
#valueNowOrOnUnwindDo:, #ifCurtailed: or #valueOnUnwindDo:. There is a
Smalllint-Rule "Contains a return in an ensure: block".

I think your test get never really executed, because you quit them
with ^1 before SUnit is actually able to check something in
#should:raise ... The ^1 will quit your method immediately, and it
will executed all the time because it is within the ensure.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list