Fixes unit tests.

This commit is contained in:
Krunoslav Zaher 2016-03-12 22:00:33 +01:00
parent e43a6785be
commit 4e860a541e
1 changed files with 11 additions and 0 deletions

View File

@ -43,6 +43,17 @@ class ControlTests : RxTest {
control = nil
}
// this code is here to flush any events that were scheduled to
// run on main loop
dispatch_async(dispatch_get_main_queue()) {
let runLoop = CFRunLoopGetCurrent()
CFRunLoopStop(runLoop)
}
let runLoop = CFRunLoopGetCurrent()
CFRunLoopWakeUp(runLoop)
CFRunLoopRun()
XCTAssertTrue(deallocated)
XCTAssertTrue(completed)
XCTAssertEqual(initialValue, lastReturnedPropertyValue)