v0.6.0-rc4: Command Mocking Support
Pre-release
Pre-release
·
743 commits
to master
since this release
What's New
🎭 Command Mocking Support
- Added class for mocking external commands during testing
- Override command paths with
- Thread-safe implementation with full test coverage
- Perfect for testing code that uses interactive tools like fzf, git, etc.
📚 Documentation
- Added Testing and Mocking section to README.md
- Updated CLAUDE.md with mocking examples and API reference
🔧 Other Changes
- Added to test helpers
- Fixed nullable reference warnings in tests
- Renamed Configuration.cs to CliConfiguration.cs for consistency
Example Usage
// Set up mocks for testing
CliConfiguration.SetCommandPath("fzf", "/path/to/mock/fzf");
// Your code using fzf will now use the mock
var result = await Fzf.Run()
.FromInput(choices)
.GetStringAsync();
// Clean up
CliConfiguration.Reset();