Skip to content

Commit d303f72

Browse files
committed
test: updated tests throwing errors to match expected errors
1 parent 198b079 commit d303f72

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

SimpleKeychainTests/SimpleKeychainSpec.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,15 @@ class SimpleKeychainTests: XCTestCase {
131131
}
132132

133133
func testRetrievingNonExistingStringItem() {
134-
XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST"))
134+
XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST")) { error in
135+
XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound)
136+
}
135137
}
136138

137139
func testRetrievingNonExistingDataItem() {
138-
XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST"))
140+
XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST")) { error in
141+
XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound)
142+
}
139143
}
140144

141145
func testRetrievingStringItemThatCannotBeDecoded() {

0 commit comments

Comments
 (0)