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 @@ -123,6 +123,27 @@ class SignalProducerSpec: QuickSpec {
123123 startDisposable. dispose ( )
124124 expect ( addedDisposable. isDisposed) == true
125125 }
126+
127+ it ( " should deliver the interrupted event with respect to the applied asynchronous operators " ) {
128+ let scheduler = TestScheduler ( )
129+ var signalInterrupted = false
130+ var observerInterrupted = false
131+
132+ let ( signal, _) = Signal < Int , NoError > . pipe ( )
133+
134+ SignalProducer ( signal)
135+ . observe ( on: scheduler)
136+ . on ( interrupted: { signalInterrupted = true } )
137+ . startWithInterrupted { observerInterrupted = true }
138+ . dispose ( )
139+
140+ expect ( signalInterrupted) == false
141+ expect ( observerInterrupted) == false
142+
143+ scheduler. run ( )
144+ expect ( signalInterrupted) == true
145+ expect ( observerInterrupted) == true
146+ }
126147 }
127148
128149 describe ( " init(signal:) " ) {
You can’t perform that action at this time.
0 commit comments