Skip to content

0.7.0

Choose a tag to compare

@nikolainobadi nikolainobadi released this 16 Aug 21:59
· 8 commits to main since this release
b938f71

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

  • throwError on MockFileSystem and MockDirectory — one flag fails every throwing operation, for exercising error paths.
  • fileContentsToRead on MockFileSystem — stub readFile(at:) by absolute path, no directory wiring needed.
  • writtenFilePath / writtenFileContents on MockFileSystem — assert a write happened without configuring a directory.

Changed

  • ⚠️ Breaking: MockDirectory(autoCreateSubdirectories:) now defaults to false. subdirectory(named:) throws for unknown names instead of synthesizing one, which keeps containsSubdirectory(named:) honest. Pass true to restore the old behavior.
  • MockDirectory.createSubdirectory(named:) now registers the new subdirectory in subdirectories.

Fixed

  • NnFileKitTests was missing its NnFileTesting dependency, so swift test did not compile. Adding it surfaced — and this release fixes — the mock gaps above.
  • MockFileSystem.readFile(at:) throws FileSystemError.fileNotFound instead of an opaque NSError.

Upgrading

.package(url: "https://github.com/nikolainobadi/NnFileKit.git", from: "0.7.0")

Tests relying on subdirectory(named:) always succeeding need autoCreateSubdirectories: true.