restores Helder in all its glory
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import Foundation
|
||||
import HelderCore
|
||||
import HelderServices
|
||||
|
||||
/// A watcher the test fires by hand.
|
||||
final class FakeWatcher: FileWatching {
|
||||
private(set) var root: URL?
|
||||
private(set) var stopped = false
|
||||
private var handler: (@Sendable (WatchEvent) -> Void)?
|
||||
|
||||
func start(root: URL, handler: @escaping @Sendable (WatchEvent) -> Void) {
|
||||
self.root = root
|
||||
self.handler = handler
|
||||
}
|
||||
|
||||
func stop() { stopped = true }
|
||||
func emit(_ event: WatchEvent) { handler?(event) }
|
||||
}
|
||||
Reference in New Issue
Block a user