About exception propagation with ensure:

stéphane ducasse ducasse at iam.unibe.ch
Fri Oct 28 15:40:42 UTC 2005


On 28 oct. 05, at 15:45, Lukas Renggli wrote:

>> 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.

cool.
Thanks for that feedback.
I should write a better test then.

Stef

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




More information about the Squeak-dev mailing list