-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translate XCTAssert* failures into Cedar spec failures
- Loading branch information
1 parent
4bc5098
commit 95d2988
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Cedar | ||
import XCTest | ||
|
||
class XCTAssertSpec: CDRSpec { | ||
override func declareBehaviors() { | ||
describe("XCTAssert calls in a Swift Cedar spec") { | ||
it("should allow a passing assertion") { | ||
XCTAssertEqual(1, 1) | ||
} | ||
|
||
it("should allow a failing assertion") { | ||
expectFailureWithMessage("XCTAssertEqual failed: (\"Optional(1)\") is not equal to (\"Optional(2)\") - Failure") { | ||
XCTAssertEqual(1, 2, "Failure") | ||
} | ||
} | ||
} | ||
} | ||
} |