Skip to content

Commit

Permalink
Fixed test compilation with Xcode 15 (#2602)
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto authored Jun 9, 2023
1 parent 14a7ea1 commit c718e87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Tests/UnitTests/Networking/NetworkErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class NetworkErrorTests: TestCase {
}

private func check<T>(
_ value: T, condition: Predicate<T>, descrition: String,
_ value: T, condition: Nimble.Predicate<T>, descrition: String,
file: FileString = #file, line: UInt = #line
) {
expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private extension TransactionPosterTests {

}

private func match(_ data: PurchasedTransactionData) -> Predicate<PurchasedTransactionData> {
private func match(_ data: PurchasedTransactionData) -> Nimble.Predicate<PurchasedTransactionData> {
return .init {
let other = try $0.evaluate()
let matches = (other?.appUserID == data.appUserID &&
Expand Down
14 changes: 7 additions & 7 deletions Tests/UnitTests/TestHelpers/Matchers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import Nimble

// MARK: - Dates

func beCloseToNow() -> Predicate<Date> {
func beCloseToNow() -> Nimble.Predicate<Date> {
return beCloseToDate(Date())
}

func beCloseToDate(_ expectedValue: Date) -> Predicate<Date> {
func beCloseToDate(_ expectedValue: Date) -> Nimble.Predicate<Date> {
return beCloseTo(expectedValue, within: 1)
}

Expand All @@ -32,31 +32,31 @@ func beCloseToDate(_ expectedValue: Date) -> Predicate<Date> {

/// Overload for `Nimble.matchError` that ignores the `PurchasesError` type and compares them as `Error`
/// (comparing the domain and code)
func matchError(_ error: PurchasesError) -> Predicate<Error> {
func matchError(_ error: PurchasesError) -> Nimble.Predicate<Error> {
return Nimble.matchError(error as Error)
}

/// Overload for `Nimble.matchError` that ignores the `ErrorCode` type and compares them as `Error`
/// (comparing the domain and code)
func matchError(_ error: ErrorCode) -> Predicate<Error> {
func matchError(_ error: ErrorCode) -> Nimble.Predicate<Error> {
return Nimble.matchError(error as Error)
}

/// Overload for `Nimble.throwError` that ignores the `PurchasesError` type and compares them as `Error`
/// (comparing the domain and code)
public func throwError<Out>(_ error: PurchasesError) -> Predicate<Out> {
public func throwError<Out>(_ error: PurchasesError) -> Nimble.Predicate<Out> {
return Nimble.throwError(error as Error)
}

/// Overload for `Nimble.throwError` that ignores the `ErrorCode` type and compares them as `Error`
/// (comparing the domain and code)
public func throwError<Out>(_ error: ErrorCode) -> Predicate<Out> {
public func throwError<Out>(_ error: ErrorCode) -> Nimble.Predicate<Out> {
return Nimble.throwError(error as Error)
}

// MARK: - Data

func matchJSONData(_ other: Data) -> Predicate<Data> {
func matchJSONData(_ other: Data) -> Nimble.Predicate<Data> {
return equal(other.serialized)
}

Expand Down

0 comments on commit c718e87

Please sign in to comment.