Repository navigation
0.7.0
NnFileKit 0.7.0
Testing-focused release. NnFileTesting's mocks gain error injection and write recording, and the NnFileKit skill now ships from this repo.
Added
throwErroronMockFileSystemandMockDirectory— one flag fails every throwing operation, for exercising error paths.fileContentsToReadonMockFileSystem— stubreadFile(at:)by absolute path, no directory wiring needed.writtenFilePath/writtenFileContentsonMockFileSystem— assert a write happened without configuring a directory.
Changed
⚠️ Breaking:MockDirectory(autoCreateSubdirectories:)now defaults tofalse.subdirectory(named:)throws for unknown names instead of synthesizing one, which keepscontainsSubdirectory(named:)honest. Passtrueto restore the old behavior.MockDirectory.createSubdirectory(named:)now registers the new subdirectory insubdirectories.
Fixed
NnFileKitTestswas missing itsNnFileTestingdependency, soswift testdid not compile. Adding it surfaced — and this release fixes — the mock gaps above.MockFileSystem.readFile(at:)throwsFileSystemError.fileNotFoundinstead of an opaqueNSError.
Upgrading
.package(url: "https://github.com/nikolainobadi/NnFileKit.git", from: "0.7.0")Tests relying on subdirectory(named:) always succeeding need autoCreateSubdirectories: true.