Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Sources/Nimble/Matchers/ThrowAssertion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ public func catchBadInstruction(block: @escaping () -> Void) -> BadInstructionEx

public func throwAssertion<Out>() -> Predicate<Out> {
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)
Expand Down
2 changes: 2 additions & 0 deletions Tests/NimbleTests/Matchers/ThrowAssertionTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -75,3 +76,4 @@ final class ThrowAssertionTest: XCTestCase {
#endif
}
}
#endif