[Pharo-project] About testing that ensure works

Stéphane Ducasse stephane.ducasse at inria.fr
Sun Apr 24 12:26:07 CEST 2011


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:

Stef





More information about the Pharo-project mailing list