File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
SimmerTests/MonitoringTests Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -67,16 +67,12 @@ internal final class LogMonitorTests: XCTestCase {
6767 let queue = bundle. queue
6868
6969 let notificationExpectation = expectation ( description: " patterns change broadcast " )
70- var observer : NSObjectProtocol ?
71- observer = notificationCenter. addObserver (
70+ notificationExpectation . assertForOverFulfill = false
71+ let observer = notificationCenter. addObserver (
7272 forName: . logMonitorPatternsDidChange,
7373 object: nil ,
7474 queue: . main
7575 ) { _ in
76- if let token = observer {
77- notificationCenter. removeObserver ( token)
78- observer = nil
79- }
8076 notificationExpectation. fulfill ( )
8177 }
8278
@@ -94,6 +90,8 @@ internal final class LogMonitorTests: XCTestCase {
9490
9591 await fulfillment ( of: [ alertExpectation, notificationExpectation] , timeout: 1.0 )
9692
93+ notificationCenter. removeObserver ( observer)
94+
9795 let updated = storeRef. loadPatterns ( ) . first { $0. id == patternID }
9896 XCTAssertEqual ( updated? . enabled, false )
9997
You can’t perform that action at this time.
0 commit comments