From 1ca9fa3ae260e696e76ca68938bf9428c3ec02c6 Mon Sep 17 00:00:00 2001 From: Daniel Saidi Date: Thu, 30 Dec 2021 10:38:46 +0100 Subject: [PATCH] Disable ThrowAssertion for watchOS --- Sources/Nimble/Matchers/ThrowAssertion.swift | 5 +++-- Tests/NimbleTests/Matchers/ThrowAssertionTest.swift | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/Nimble/Matchers/ThrowAssertion.swift b/Sources/Nimble/Matchers/ThrowAssertion.swift index 20d4709d8..34a94fb3f 100644 --- a/Sources/Nimble/Matchers/ThrowAssertion.swift +++ b/Sources/Nimble/Matchers/ThrowAssertion.swift @@ -84,9 +84,10 @@ public func catchBadInstruction(block: @escaping () -> Void) -> BadInstructionEx public func throwAssertion() -> Predicate { return Predicate { actualExpression in - #if (arch(x86_64) || arch(arm64)) && (canImport(Darwin) || canImport(Glibc)) + #if os(watchOS) + fatalError("Nimble currently doesn't support watchOS.") + #elseif (arch(x86_64) || arch(arm64)) && (canImport(Darwin) || canImport(Glibc)) let message = ExpectationMessage.expectedTo("throw an assertion") - var actualError: Error? let caughtException: BadInstructionException? = catchBadInstruction { #if os(tvOS) diff --git a/Tests/NimbleTests/Matchers/ThrowAssertionTest.swift b/Tests/NimbleTests/Matchers/ThrowAssertionTest.swift index 641797dad..3f708ee17 100644 --- a/Tests/NimbleTests/Matchers/ThrowAssertionTest.swift +++ b/Tests/NimbleTests/Matchers/ThrowAssertionTest.swift @@ -4,6 +4,7 @@ import Nimble private let error: Error = NSError(domain: "test", code: 0, userInfo: nil) +#if !os(watchOS) final class ThrowAssertionTest: XCTestCase { func testPositiveMatch() { #if arch(x86_64) || arch(arm64) @@ -75,3 +76,4 @@ final class ThrowAssertionTest: XCTestCase { #endif } } +#endif