Trait assert_fs::PathChild [−][src]
Access paths within TempDir
for testing.
See ChildPath
Trait Implementations.
use assert_fs::prelude::*; let temp = assert_fs::TempDir::new().unwrap(); let input_file = temp.child("foo.txt"); input_file.touch().unwrap(); temp.close().unwrap();
Required Methods
fn child<P>(&self, path: P) -> ChildPath where
P: AsRef<Path>,
P: AsRef<Path>,
Create a path within the temp directory.
Examples
use assert_fs::prelude::*; let temp = assert_fs::TempDir::new().unwrap(); println!("{:?}", temp.path()); println!("{:?}", temp.child("foo/bar.txt").path()); temp.close().unwrap();
Implementors
impl PathChild for TempDir