Skip to content

Commit

Permalink
Merge pull request Quick#341 from Quick/linux-fix-synchronous-tests
Browse files Browse the repository at this point in the history
Improve SynchronousTests.swift on Linux with avoiding error bridging
  • Loading branch information
jeffh authored Sep 27, 2016
2 parents ce91b1b + b7c9304 commit 9ed51e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/NimbleTests/SynchronousTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ final class SynchronousTest: XCTestCase, XCTestCaseProvider {
]
}

let errorToThrow = NSError(domain: NSCocoaErrorDomain, code: 42, userInfo: nil)
class Error: Swift.Error {}
let errorToThrow = Error()

private func doThrowError() throws -> Int {
throw errorToThrow
}
Expand All @@ -36,14 +38,12 @@ final class SynchronousTest: XCTestCase, XCTestCaseProvider {
}

func testUnexpectedErrorsThrownFails() {
#if _runtime(_ObjC) // This test triggers a weird segfault on Linux currently
failsWithErrorMessage("expected to equal <1>, got an unexpected error thrown: <\(errorToThrow)>") {
expect { try self.doThrowError() }.to(equal(1))
}
failsWithErrorMessage("expected to not equal <1>, got an unexpected error thrown: <\(errorToThrow)>") {
expect { try self.doThrowError() }.toNot(equal(1))
}
#endif
}

func testToMatchesIfMatcherReturnsTrue() {
Expand Down

0 comments on commit 9ed51e1

Please sign in to comment.