Add test for rebuild after deletion

This commit is contained in:
Vincent Prouillet 2018-11-19 17:25:24 +01:00
parent a465d6a61e
commit 9a99b40216

View file

@ -234,3 +234,15 @@ fn can_rebuild_after_renaming_non_md_asset_in_colocated_folder() {
let res = after_content_rename(&mut site, &old_path, &new_path); let res = after_content_rename(&mut site, &old_path, &new_path);
assert!(res.is_ok()); assert!(res.is_ok());
} }
#[test]
fn can_rebuild_after_deleting_file() {
let tmp_dir = tempdir().expect("create temp dir");
let (site_path, mut site) = load_and_build_site!(tmp_dir);
let path = site_path.join("content").join("posts").join("fixed-slug.md");
fs::remove_file(&path).unwrap();
let res = after_content_change(&mut site, &path);
println!("{:?}", res);
assert!(res.is_ok());
}