forked from swiftyfinch/Rugby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99de828
commit c1727b7
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
Tests/FoundationTests/Mocks/IFileContentHasherMock.generated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Generated using Sourcery 2.1.1 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
// swiftlint:disable all | ||
|
||
import Foundation | ||
@testable import RugbyFoundation | ||
|
||
final class IFileContentHasherMock: IFileContentHasher { | ||
|
||
// MARK: - hashContext | ||
|
||
var hashContextPathsThrowableError: Error? | ||
var hashContextPathsCallsCount = 0 | ||
var hashContextPathsCalled: Bool { hashContextPathsCallsCount > 0 } | ||
var hashContextPathsReceivedPaths: [String]? | ||
var hashContextPathsReceivedInvocations: [[String]] = [] | ||
var hashContextPathsReturnValue: [String]! | ||
var hashContextPathsClosure: (([String]) async throws -> [String])? | ||
|
||
func hashContext(paths: [String]) async throws -> [String] { | ||
if let error = hashContextPathsThrowableError { | ||
throw error | ||
} | ||
hashContextPathsCallsCount += 1 | ||
hashContextPathsReceivedPaths = paths | ||
hashContextPathsReceivedInvocations.append(paths) | ||
if let hashContextPathsClosure = hashContextPathsClosure { | ||
return try await hashContextPathsClosure(paths) | ||
} else { | ||
return hashContextPathsReturnValue | ||
} | ||
} | ||
} | ||
|
||
// swiftlint:enable all |
39 changes: 39 additions & 0 deletions
39
Tests/FoundationTests/Mocks/IXcodeEnvResolverMock.generated.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Generated using Sourcery 2.1.1 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
// swiftlint:disable all | ||
|
||
import Foundation | ||
@testable import RugbyFoundation | ||
|
||
final class IXcodeEnvResolverMock: IXcodeEnvResolver { | ||
|
||
// MARK: - resolve | ||
|
||
var resolvePathAdditionalEnvThrowableError: Error? | ||
var resolvePathAdditionalEnvCallsCount = 0 | ||
var resolvePathAdditionalEnvCalled: Bool { resolvePathAdditionalEnvCallsCount > 0 } | ||
var resolvePathAdditionalEnvReceivedArguments: (path: String, additionalEnv: [String: String])? | ||
var resolvePathAdditionalEnvReceivedInvocationsLock = NSLock() | ||
var resolvePathAdditionalEnvReceivedInvocations: [(path: String, additionalEnv: [String: String])] = [] | ||
var resolvePathAdditionalEnvReturnValue: String! | ||
var resolvePathAdditionalEnvClosure: ((String, [String: String]) async throws -> String)? | ||
|
||
func resolve(path: String, additionalEnv: [String: String]) async throws -> String { | ||
if let error = resolvePathAdditionalEnvThrowableError { | ||
throw error | ||
} | ||
resolvePathAdditionalEnvCallsCount += 1 | ||
resolvePathAdditionalEnvReceivedArguments = (path: path, additionalEnv: additionalEnv) | ||
resolvePathAdditionalEnvReceivedInvocationsLock.withLock { | ||
resolvePathAdditionalEnvReceivedInvocations.append((path: path, additionalEnv: additionalEnv)) | ||
} | ||
if let resolvePathAdditionalEnvClosure = resolvePathAdditionalEnvClosure { | ||
return try await resolvePathAdditionalEnvClosure(path, additionalEnv) | ||
} else { | ||
return resolvePathAdditionalEnvReturnValue | ||
} | ||
} | ||
} | ||
|
||
// swiftlint:enable all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters