Skip to content

Commit ee09d96

Browse files
author
Joris Timmerman
committed
Fixed tests :)
1 parent 6629cc8 commit ee09d96

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Example/Tests/Specs/Keychain/KeychainSpec.swift

+10-9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Keychain
1414
// Define the keys used for this test.
1515
extension Keys {
1616
static let stringValue = Key<String?>("stringValue")
17+
static let codableValue = Key<String?>("codableValue")
1718
}
1819

1920
private struct TestCodable: Codable, Equatable {
@@ -52,29 +53,29 @@ class KeychainSpec: QuickSpec {
5253
it("should be able to write a codable value to the keychain") {
5354
let value = TestCodable(identifier: "123",
5455
timestamp: Date(timeIntervalSince1970: 2000))
55-
keychain[.testKey] = value
56-
expect(keychain[.testKey]) == value
56+
Keychain[.codableValue] = value
57+
expect(Keychain[.codableValue]) == value
5758
}
5859

5960
it("Should override a codable value to the keychain") {
6061
let value1 = TestCodable(identifier: "123",
6162
timestamp: Date(timeIntervalSince1970: 2000))
6263
let value2 = TestCodable(identifier: "456",
6364
timestamp: Date(timeIntervalSince1970: 3000))
64-
keychain[.testKey] = value1
65-
keychain[.testKey] = value2
65+
Keychain[.codableValue] = value1
66+
Keychain[.codableValue] = value2
6667

67-
expect(keychain[.testKey]) == value2
68+
expect(Keychain[.codableValue]) == value2
6869
}
6970

7071
it("should be able to delete a codable value from the keychain") {
7172
let value = TestCodable(identifier: "123",
7273
timestamp: Date(timeIntervalSince1970: 2000))
73-
keychain[.testKey] = value
74-
expect(keychain[.testKey]).toNot(beNil())
74+
Keychain[.codableValue] = value
75+
expect(Keychain[.codableValue]).toNot(beNil())
7576

76-
keychain[.testKey] = nil
77-
expect(keychain[.testKey]).to(beNil())
77+
Keychain[.codableValue] = nil
78+
expect(Keychain[.codableValue]).to(beNil())
7879
}
7980
}
8081
}

0 commit comments

Comments
 (0)