-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
enhancementImprove the expectedImprove the expected
Milestone
Description
What this would bring over using the existing copy_from() for a single file is the ability to copy the file to a different name. Basically I'd like the semantics of write_binary() and write_str() but using an existing file as source.
use assert_fs::prelude::*;
let temp = assert_fs::TempDir::new().unwrap();
temp
.child("input.txt")
.write_file("unittest.42.txt")
.unwrap();
temp.close().unwrap();The rationale is that my program uses fixed names for various input files (and/or I don't want to bother configuring my program to use other filenames), but I have many different input files for as many different unittests. I want to say "for this test, the content of input.txt will be taken from that example file".
sourcefrog
Metadata
Metadata
Assignees
Labels
enhancementImprove the expectedImprove the expected