diff --git a/tests/test_git.rs b/tests/test_git.rs index 1229eab..0e0ead8 100644 --- a/tests/test_git.rs +++ b/tests/test_git.rs @@ -25,8 +25,32 @@ mod git assert!(!repo.as_ref().unwrap().is_empty().unwrap()); assert!(Path::exists(Path::new(path))); + if Path::exists(Path::new(path)) + { + let _ = remove_dir_all(Path::new(path)); + } + } + + #[test] + pub fn test_clean_and_clone() + { + let config = GitConfig + { + remote: "https://github.com/JerboaBurrow/Busser".into(), + branch: "main".into(), + checkout_schedule: None, + auth: None, + }; + + let path = "tests/test_clean_and_clone"; + let repo = from_clone(path.into(), &config); + + assert!(repo.is_ok()); + assert!(!repo.as_ref().unwrap().is_empty().unwrap()); + assert!(Path::exists(Path::new(path))); + let repo = clean_and_clone(path.into(), config); - + println!("{:?}",repo.as_ref().err()); assert!(repo.is_ok()); assert!(!repo.as_ref().unwrap().is_empty().unwrap()); assert!(Path::exists(Path::new(path)));