File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,8 @@ public func postNotifications<T>(
7474 let collector = NotificationCollector ( notificationCenter: center)
7575 collector. startObserving ( )
7676 var once : Bool = false
77- return Predicate . fromDeprecatedClosure { actualExpression, failureMessage in
77+
78+ return Predicate { actualExpression in
7879 let collectorNotificationsExpression = Expression ( memoizedExpression: { _ in
7980 return collector. observedNotifications
8081 } , location: actualExpression. location, withoutCaching: true )
@@ -85,12 +86,13 @@ public func postNotifications<T>(
8586 _ = try actualExpression. evaluate ( )
8687 }
8788
89+ let failureMessage = FailureMessage ( )
8890 let match = try notificationsMatcher. matches ( collectorNotificationsExpression, failureMessage: failureMessage)
8991 if collector. observedNotifications. isEmpty {
9092 failureMessage. actualValue = " no notifications "
9193 } else {
9294 failureMessage. actualValue = " < \( stringify ( collector. observedNotifications) ) > "
9395 }
94- return match
96+ return PredicateResult ( bool : match, message : failureMessage . toExpectationMessage ( ) )
9597 }
9698}
You can’t perform that action at this time.
0 commit comments