Skip to content

Commit

Permalink
run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ski-u authored and github-actions[bot] committed Dec 14, 2024
1 parent 58e0db5 commit da56b33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Features/Sources/APIKeyClientLive/LiveKey.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import APIKeyClient
import Dependencies
import Models
@preconcurrency import KeychainAccess
import Models

extension APIKeyClient: DependencyKey {
public static let liveValue: Self = .liveValue(service: "dev.ynskski.NASAClient")

static func liveValue(service: String) -> APIKeyClient {
let keychain = Keychain(service: service)

return .init(
getKey: {
keychain["APIKey"].map(APIKey.init(rawValue:))
Expand Down
13 changes: 7 additions & 6 deletions NASAClientTests/APIKeyClientLive/APIKeyClientLiveTests.swift
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import APIKeyClient
@testable import APIKeyClientLive
import Models
import KeychainAccess
import Models
import Testing

@testable import APIKeyClientLive

struct APIKeyClientLiveTests {
let keychain = Keychain(service: "test")

init() {
try! keychain.removeAll()
}

@Test
func liveValue() {
let client = APIKeyClient.liveValue(service: "test")
let key = APIKey(rawValue: "key")

client.setKey(key)
#expect(client.getKey() == key)

client.setKey(nil)
#expect(client.getKey() == nil)
}
Expand Down

0 comments on commit da56b33

Please sign in to comment.