this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 52ec9ed3a28388caee2e1d877b9b3eaf727655b6 24 lines 722 B view raw
1use assert_fs::prelude::*; 2use predicates::prelude::*; 3 4pub fn create_test_file( 5 name: &str, 6 content: &str, 7) -> Result<assert_fs::NamedTempFile, Box<dyn std::error::Error>> { 8 let file = assert_fs::NamedTempFile::new(name)?; 9 file.write_str(content)?; 10 Ok(file) 11} 12 13pub fn create_working_dir() -> Result<assert_fs::TempDir, Box<dyn std::error::Error>> { 14 Ok(assert_fs::TempDir::new()?) 15} 16 17#[allow(dead_code)] 18pub fn create_persistent_working_dir() -> Result<assert_fs::TempDir, Box<dyn std::error::Error>> { 19 Ok(assert_fs::TempDir::new()?.into_persistent()) 20} 21 22pub fn assert_files_equal(file1: &std::path::Path, file2: &std::path::Path) { 23 assert!(predicate::path::eq_file(file1).eval(file2)); 24}