Update value paramter of Waiter to object (#3)
This commit is contained in:
parent
71eeae35ae
commit
3cd5683867
|
@ -1,9 +1,9 @@
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct Waiter<Value: AnyObject>: Waitable {
|
public struct Waiter<Object: AnyObject>: Waitable {
|
||||||
public var value: Value
|
public var object: Object
|
||||||
|
|
||||||
public init(_ value: Value) {
|
public init(_ object: Object) {
|
||||||
self.value = value
|
self.object = object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ final class TestTests: XCTestCase {
|
||||||
let waiter = Waiter(value)
|
let waiter = Waiter(value)
|
||||||
|
|
||||||
try await waiter.wait(
|
try await waiter.wait(
|
||||||
for: \.value.count,
|
for: \.object.count,
|
||||||
expecting: 0
|
expecting: 0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ final class TestTests: XCTestCase {
|
||||||
|
|
||||||
XCTAssertEqual(value.count, 0)
|
XCTAssertEqual(value.count, 0)
|
||||||
|
|
||||||
try await waiter.wait(for: \.value.count, duration: 2, interval: 0.5, expecting: 1)
|
try await waiter.wait(for: \.object.count, duration: 2, interval: 0.5, expecting: 1)
|
||||||
|
|
||||||
XCTAssertEqual(value.count, 1)
|
XCTAssertEqual(value.count, 1)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue