File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,27 @@ class SignalProducerSpec: QuickSpec {
127127 startDisposable. dispose ( )
128128 expect ( addedDisposable. isDisposed) == true
129129 }
130+
131+ it ( " should deliver the interrupted event immediately " ) {
132+ let scheduler = TestScheduler ( )
133+ var signalInterrupted = false
134+ var observerInterrupted = false
135+
136+ let ( signal, _) = Signal < Int , NoError > . pipe ( )
137+
138+ SignalProducer ( signal)
139+ . observe ( on: scheduler)
140+ . on ( interrupted: { signalInterrupted = true } )
141+ . startWithInterrupted { observerInterrupted = true }
142+ . dispose ( )
143+
144+ expect ( signalInterrupted) == false
145+ expect ( observerInterrupted) == false
146+
147+ scheduler. run ( )
148+ expect ( signalInterrupted) == true
149+ expect ( observerInterrupted) == true
150+ }
130151 }
131152
132153 describe ( " init(signal:) " ) {
You can’t perform that action at this time.
0 commit comments