Rust unit testing: file writing
To test file writes without hitting the disk, the author swaps in a closure that takes a file handle. That handle’s a test double, so after the code runs, you can crack it open and inspect what got written... read more






