Tests pass.

This commit is contained in:
Andrés N. Robalino
2019-08-06 02:05:47 -05:00
parent b38d54e033
commit 1b7dd52713
6 changed files with 245 additions and 72 deletions

View File

@ -181,12 +181,21 @@ pub fn copy_file_to(source: &str, destination: &str) {
std::fs::copy(source, destination).expect("can not copy file");
}
pub fn file_exists_at(full_path: &str) -> bool {
PathBuf::from(full_path).exists()
pub fn files_exist_at(files: Vec<&Path>, path: PathBuf) -> bool {
files.iter()
.all(|f| {
let mut loc = path.clone();
loc.push(f);
loc.exists()
})
}
pub fn dir_exists_at(full_path: &str) -> bool {
PathBuf::from(full_path).exists()
pub fn file_exists_at(path: PathBuf) -> bool {
path.exists()
}
pub fn dir_exists_at(path: PathBuf) -> bool {
path.exists()
}
pub fn delete_directory_at(full_path: &str) {