From 281e4717f89a04563b8352ec3fa93e96de960002 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Tue, 26 Jun 2018 21:10:13 +0900 Subject: [PATCH] Refactor `beVoid` matcher using `Predicate.simpleNilable` --- Sources/Nimble/Matchers/BeVoid.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/Nimble/Matchers/BeVoid.swift b/Sources/Nimble/Matchers/BeVoid.swift index f5bf22a20..a9dbc2893 100644 --- a/Sources/Nimble/Matchers/BeVoid.swift +++ b/Sources/Nimble/Matchers/BeVoid.swift @@ -2,10 +2,9 @@ import Foundation /// A Nimble matcher that succeeds when the actual value is Void. public func beVoid() -> Predicate<()> { - return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in - failureMessage.postfixMessage = "be void" + return Predicate.simpleNilable("be void") { actualExpression in let actualValue: ()? = try actualExpression.evaluate() - return actualValue != nil + return PredicateStatus(bool: actualValue != nil) } }