Skip to content

Commit

Permalink
Apple SDK now also contains Predicate type, so it's an error now wi…
Browse files Browse the repository at this point in the history
…thout framework prefix [Xcode 15].
  • Loading branch information
maratal committed Sep 15, 2023
1 parent 800648a commit 64967fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Test/Test Utilities/TestUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ extension ARTPresenceAction : CustomStringConvertible {
// MARK: - Custom Nimble Matchers

/// A Nimble matcher that succeeds when two dates are quite the same.
public func beCloseTo(_ expectedValue: Date) -> Predicate<Date> {
public func beCloseTo(_ expectedValue: Date) -> Nimble.Predicate<Date> {
let errorMessage = "be close to <\(expectedValue)> (within 0.5)"
return Predicate.simple(errorMessage) { actualExpression in
guard let actualValue = try actualExpression.evaluate() else {
Expand All @@ -1758,7 +1758,7 @@ public func beCloseTo(_ expectedValue: Date) -> Predicate<Date> {
}

/// A Nimble matcher that succeeds when a param exists.
public func haveParam(_ key: String, withValue expectedValue: String? = nil) -> Predicate<String> {
public func haveParam(_ key: String, withValue expectedValue: String? = nil) -> Nimble.Predicate<String> {
let errorMessage = "param <\(key)=\(expectedValue ?? "nil")> exists"
return Predicate.simple(errorMessage) { actualExpression in
guard let actualValue = try actualExpression.evaluate() else {
Expand All @@ -1776,7 +1776,7 @@ public func haveParam(_ key: String, withValue expectedValue: String? = nil) ->
}

/// A Nimble matcher that succeeds when a param value starts with a particular string.
public func haveParam(_ key: String, hasPrefix expectedValue: String) -> Predicate<String> {
public func haveParam(_ key: String, hasPrefix expectedValue: String) -> Nimble.Predicate<String> {
let errorMessage = "param <\(key)> has prefix \(expectedValue)"
return Predicate.simple(errorMessage) { actualExpression in
guard let actualValue = try actualExpression.evaluate() else {
Expand Down
2 changes: 1 addition & 1 deletion Test/Tests/RestClientChannelsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extension ARTRestChannels: Sequence {
}
}

private func beAChannel(named expectedValue: String) -> Predicate<ARTChannel> {
private func beAChannel(named expectedValue: String) -> Nimble.Predicate<ARTChannel> {
return Predicate.define("be a channel with name \"\(expectedValue)\"") { actualExpression, msg -> PredicateResult in
let actualValue = try actualExpression.evaluate()
let m = msg.appended(details: "\"\(actualValue?.name ?? "nil")\" instead")
Expand Down

0 comments on commit 64967fe

Please sign in to comment.