Skip to content
Snippets Groups Projects
Commit 784cf343 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add version getter functors

parent eccadfed
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
import Bindings
import XCTestDynamicOverlay
public struct GetGitVersion {
public var run: () -> String
public func callAsFunction() -> String {
run()
}
}
extension GetGitVersion {
public static let live = GetGitVersion(
run: BindingsGetGitVersion
)
}
extension GetGitVersion {
public static let unimplemented = GetGitVersion(
run: XCTUnimplemented("\(Self.self)")
)
}
import Bindings
import XCTestDynamicOverlay
public struct GetVersion {
public var run: () -> String
public func callAsFunction() -> String {
run()
}
}
extension GetVersion {
public static let live = GetVersion(
run: BindingsGetVersion
)
}
extension GetVersion {
public static let unimplemented = GetVersion(
run: XCTUnimplemented("\(Self.self)")
)
}
import Bindings
public struct GitVersionProvider {
public var get: () -> String
public func callAsFunction() -> String {
get()
}
}
extension GitVersionProvider {
public static let live = GitVersionProvider(get: BindingsGetGitVersion)
}
#if DEBUG
extension GitVersionProvider {
public static let failing = GitVersionProvider { fatalError("Not implemented") }
}
#endif
import Bindings
public struct VersionProvider {
public var get: () -> String
public func callAsFunction() -> String {
get()
}
}
extension VersionProvider {
public static let live = VersionProvider(get: BindingsGetVersion)
}
#if DEBUG
extension VersionProvider {
public static let failing = VersionProvider { fatalError("Not implemented") }
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment