1
1
import Foundation
2
2
import Nimble
3
3
4
- public extension Expectation {
4
+ public extension SyncExpectation {
5
5
6
6
func toAfterTimeout( file: FileString = #file,
7
7
line: UInt = #line,
8
- _ predicate: Nimble . Predicate < T > ,
8
+ _ predicate: Nimble . Matcher < Value > ,
9
9
timeout: TimeInterval = 1.0 ) {
10
10
11
11
let timeForExecution : TimeInterval = 1.0
@@ -20,7 +20,7 @@ public extension Expectation {
20
20
21
21
func toAfterTimeoutNot( file: FileString = #file,
22
22
line: UInt = #line,
23
- _ predicate: Nimble . Predicate < T > ,
23
+ _ predicate: Nimble . Matcher < Value > ,
24
24
timeout: TimeInterval = 1.0 ) {
25
25
26
26
let timeForExecution : TimeInterval = 1.0
@@ -33,7 +33,7 @@ public extension Expectation {
33
33
}
34
34
}
35
35
36
- private func evaluateExpression( ) throws -> T ? {
36
+ private func evaluateExpression( ) throws -> Value ? {
37
37
try self . expression. evaluate ( )
38
38
}
39
39
}
@@ -42,17 +42,17 @@ public extension Expectation {
42
42
/// if they are not in the same order.
43
43
public func elementsEqualOrderAgnostic< Col1: Collection , Col2: Collection > (
44
44
_ expectedValue: Col2 ?
45
- ) -> Nimble . Predicate < Col1 > where Col1. Element: Equatable , Col1. Element == Col2 . Element {
46
- return Predicate . define ( " elementsEqualOrderAgnostic < \( stringify ( expectedValue) ) > " ) { ( actualExpression, msg) in
45
+ ) -> Nimble . Matcher < Col1 > where Col1. Element: Equatable , Col1. Element == Col2 . Element {
46
+ return Matcher . define ( " elementsEqualOrderAgnostic < \( stringify ( expectedValue) ) > " ) { ( actualExpression, msg) in
47
47
let actualValue = try actualExpression. evaluate ( )
48
48
switch ( expectedValue, actualValue) {
49
49
case ( nil , _? ) :
50
- return PredicateResult ( status: . fail, message: msg. appendedBeNilHint ( ) )
50
+ return MatcherResult ( status: . fail, message: msg. appendedBeNilHint ( ) )
51
51
case ( nil , nil ) , ( _, nil ) :
52
- return PredicateResult ( status: . fail, message: msg)
52
+ return MatcherResult ( status: . fail, message: msg)
53
53
case ( let expected? , let actual? ) :
54
54
let matches = expected. count == actual. count && expected. allSatisfy { actual. contains ( $0) }
55
- return PredicateResult ( bool: matches, message: msg)
55
+ return MatcherResult ( bool: matches, message: msg)
56
56
}
57
57
}
58
58
}
0 commit comments