FogBugz (Case [Issue]11546) SUnit - SunitResources makeAvailable is bogus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FogBugz (Case [Issue]11546) SUnit - SunitResources makeAvailable is bogus

Pharo Issue Tracker
A FogBugz case was opened by Stephane Ducasse.

Case ID:      11546
Title:        SunitResources makeAvailable is bogus
Status:       Work Needed
Category:     Bug
Project:      SUnit
Area:         Misc
Priority:     5 - Fix If Time
Milestone:    Later
Assigned To:  Everyone

URL:          https://pharo.fogbugz.com/default.asp?11546

makeAvailable
"This method must be the _only_ way to set a notNil value for the unique instance (current).  First, obtain a candidate instance and set current to a notNil placeholder (any notNil object not an instance of me would do;  this version uses false).  Next, check any subordinate resources needed by this resource.  Lastly, setUp the candidate and put it in current if it is available, ensuring that it is torn down otherwise."

| candidate |
current := nil.
^^^^^^ should be false
candidate := self new.
self resources do: [:each | each availableFor: candidate].
[candidate setUp.
candidate isAvailable ifTrue: [current := candidate]]
ensure: [current == candidate ifFalse: [candidate tearDown]]


You are subscribed to this case.  If you do not want to receive automatic notifications in the future, unsubscribe (https://pharo.fogbugz.com/default.asp?pre=preUnsubscribe&pg=pgEditBug&command=view&ixBug=11546) from this case.

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-bugtracker