Skip to content

Commit e88e791

Browse files
committed
Simplify tests
1 parent 85ff35a commit e88e791

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/GCDCoreOperationsTests/OperationTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ final class OperationTests: XCTestCase {
4848
let operation1 = GCDBlockOperation {
4949
sleep(1)
5050
op1Executed = true
51-
$0([])
5251
}
5352
var op1DidExecuteFirst = false
5453
let operation2 = GCDBlockOperation {
5554
sleep(1)
5655
op1DidExecuteFirst = op1Executed
57-
$0([])
58-
expectation.fulfill()
5956
}
6057
operation2.addDependency(operation1)
58+
operation2.addObserver(BlockObserver(finishHandler: { _, _, _ in
59+
expectation.fulfill()
60+
}))
6161

6262
let queue = GCDOperationQueue()
6363
queue.addOperation(operation2)
@@ -79,16 +79,16 @@ final class OperationTests: XCTestCase {
7979
let operation1 = GCDBlockOperation {
8080
sleep(1)
8181
op1Executed = true
82-
$0([])
8382
}
8483
var op1DidExecuteFirst = false
8584
let operation2 = GCDBlockOperation {
8685
sleep(1)
8786
op1DidExecuteFirst = op1Executed
88-
$0([])
89-
expectation.fulfill()
9087
}
9188
operation2.addDependency(operation1)
89+
operation2.addObserver(BlockObserver(finishHandler: { _, _, _ in
90+
expectation.fulfill()
91+
}))
9292

9393
let queue = GCDOperationQueue()
9494
queue.addOperation(operation2)

0 commit comments

Comments
 (0)