File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,35 @@ BlSpaceSettleTest >> testDeferOnUnopenedSpaceExecutesOnFirstPulse [
103103 aSpace settle
104104]
105105
106+ { #category : #tests }
107+ BlSpaceSettleTest >> testHostCloseSpacesClosesAllAndStopsHost [
108+
109+ | space1 space2 |
110+ space1 := self newTestingSpace.
111+ space2 := self newTestingSpace.
112+ self assert: (host spaces includes: space1).
113+ self assert: (host spaces includes: space2).
114+ self assert: host isRunning.
115+
116+ host closeSpaces.
117+ host settle.
118+ self deny: space1 isOpened.
119+ self deny: space2 isOpened.
120+ self assert: host spaces isEmpty.
121+ self deny: host isRunning
122+ ]
123+
124+ { #category : #tests }
125+ BlSpaceSettleTest >> testHostSettleWhenStoppedCompletesImmediately [
126+
127+ self deny: host isRunning.
128+ self assert: host isSettled.
129+
130+ host settle.
131+ self deny: host isRunning.
132+ self assert: host isSettled
133+ ]
134+
106135{ #category : #tests }
107136BlSpaceSettleTest >> testIsSettledWhenEmpty [
108137
Original file line number Diff line number Diff line change @@ -226,6 +226,17 @@ BlHost >> pulseProcessDo: aBlock [
226226 ^ self pulseProcess ifNotNil: aBlock
227227]
228228
229+ { #category : #' api - spaces' }
230+ BlHost >> settle [
231+ " Wait until this host has executed all pending deferred actions and reached equilibrium."
232+
233+ self
234+ waitUntil: [ self isSettled ]
235+ timeOutIf: [ false ]
236+ onCompletion: [ ]
237+ onTimeout: [ ]
238+ ]
239+
229240{ #category : #' host space - accessing' }
230241BlHost >> spaces [
231242 " Answer the collection of spaces managed by this host."
You can’t perform that action at this time.
0 commit comments