use destructivator::{destructive_changes_xml, NAME}; use std::env; use std::path::PathBuf; fn branch_all_new_dir() -> PathBuf { let root_dir = env::home_dir().unwrap().join(&format!(".{}", NAME)); root_dir.join("test-repos").join("all-new") } #[test] #[allow(unused_must_use)] fn it_knows_its_first_members() { env::set_current_dir(&branch_all_new_dir()); let destructive_changes = destructive_changes_xml(None, None, None); assert!(destructive_changes.contains("CustomApplication")); assert!(destructive_changes.contains("standard__AppLauncher")); } #[test] #[allow(unused_must_use)] fn it_knows_its_middle_members() { env::set_current_dir(&branch_all_new_dir()); let destructive_changes = destructive_changes_xml(None, None, None); assert!(destructive_changes.contains("HomePageLayout")); assert!(destructive_changes.contains("DE Default")); } #[test] #[allow(unused_must_use)] fn it_knows_its_last_members() { env::set_current_dir(&branch_all_new_dir()); let destructive_changes = destructive_changes_xml(None, None, None); assert!(destructive_changes.contains("ApexTrigger")); assert!(destructive_changes.contains("orderBeforeInsert")); }