diff --git a/SimpleKeychainTests/SimpleKeychainSpec.swift b/SimpleKeychainTests/SimpleKeychainSpec.swift index 29345bd..c167430 100644 --- a/SimpleKeychainTests/SimpleKeychainSpec.swift +++ b/SimpleKeychainTests/SimpleKeychainSpec.swift @@ -131,11 +131,15 @@ class SimpleKeychainTests: XCTestCase { } func testRetrievingNonExistingStringItem() { - XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST")) + XCTAssertThrowsError(try sut.string(forKey: "SHOULDNOTEXIST")) { error in + XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound) + } } func testRetrievingNonExistingDataItem() { - XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST")) + XCTAssertThrowsError(try sut.data(forKey: "SHOULDNOTEXIST")) { error in + XCTAssertEqual(error as? SimpleKeychainError, .itemNotFound) + } } func testRetrievingStringItemThatCannotBeDecoded() {