From 1dd41f8647d431689b44d238d95ed4bfec46628a Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Fri, 22 Sep 2017 09:04:42 +0900 Subject: [PATCH] Use the new `Predicate` type for Nimble matchers --- Tests/CarthageKitTests/ResolverSpec.swift | 4 ++-- Tests/CarthageKitTests/XcodeSpec.swift | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/CarthageKitTests/ResolverSpec.swift b/Tests/CarthageKitTests/ResolverSpec.swift index fb12587bf9..18487bf7bf 100644 --- a/Tests/CarthageKitTests/ResolverSpec.swift +++ b/Tests/CarthageKitTests/ResolverSpec.swift @@ -102,7 +102,7 @@ private func ==(lhs: [(A, B)], rhs: [(A, B)]) -> Boo return true } -private func equal(_ expectedValue: [(A, B)]?) -> NonNilMatcherFunc<[(A, B)]> { +private func equal(_ expectedValue: [(A, B)]?) -> Predicate<[(A, B)]> { return NonNilMatcherFunc { actualExpression, failureMessage in failureMessage.postfixMessage = "equal <\(stringify(expectedValue))>" let actualValue = try actualExpression.evaluate() @@ -113,7 +113,7 @@ private func equal(_ expectedValue: [(A, B)]?) -> No return false } return expectedValue! == actualValue! - } + }.predicate } private func ==(lhs: Expectation<[(A, B)]>, rhs: [(A, B)]) { diff --git a/Tests/CarthageKitTests/XcodeSpec.swift b/Tests/CarthageKitTests/XcodeSpec.swift index d38c30913e..05e2e130b0 100644 --- a/Tests/CarthageKitTests/XcodeSpec.swift +++ b/Tests/CarthageKitTests/XcodeSpec.swift @@ -400,7 +400,7 @@ class XcodeSpec: QuickSpec { // MARK: Matcher -internal func beExistingDirectory() -> MatcherFunc { +internal func beExistingDirectory() -> Predicate { return MatcherFunc { actualExpression, failureMessage in failureMessage.postfixMessage = "exist and be a directory" let actualPath = try actualExpression.evaluate() @@ -417,10 +417,10 @@ internal func beExistingDirectory() -> MatcherFunc { } return exists && isDirectory.boolValue - } + }.predicate } -internal func beRelativeSymlinkToDirectory(_ directory: URL) -> MatcherFunc { +internal func beRelativeSymlinkToDirectory(_ directory: URL) -> Predicate { return MatcherFunc { actualExpression, failureMessage in failureMessage.postfixMessage = "be a relative symlink to \(directory)" let actualURL = try actualExpression.evaluate() @@ -454,5 +454,5 @@ internal func beRelativeSymlinkToDirectory(_ directory: URL) -> MatcherFunc } return urlsEqual - } + }.predicate }