Add a way to provide a prefix to TempFile
This was motivated by the tests tripping up when running in parallel
(the default for cargo test
). The tests failed intermittently
in the following scenario:
-
two_files
test would create a tempfile then remove a temporary file; -
read
test would create a tempfile and able to pick the same name; -
two_files
would check if the file was not there anymore, but it was!
Isolating the two_files
test with its own prefix fixes the issue.