[Pharo-project] About testing that ensure works

Igor Stasenko siguctua at gmail.com
Sun Apr 24 12:43:21 CEST 2011


On 24 April 2011 13:26, Stéphane Ducasse <stephane.ducasse at inria.fr> wrote:
> here is a simpler case
>
> do: aBlock
>
>        x := 5.
>        [aBlock value]  ensure: [x :=3]
>
> testDo
>        "self run: #testDo"
>
>        self do: [ self error].
>        self assert: x = 3
>
>
> and I do not understand why ensure is not executed :(
> because I always want the ensure to happen not only on ifCurtailed:
>

error are not causing ensure block to trigger.
only after you either abandon or proceed, an ensure block will be executed.


> Stef
>

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Pharo-project mailing list