From 9a99b4021677da449715d96dc42866e89dbb0abd Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Mon, 19 Nov 2018 17:25:24 +0100 Subject: [PATCH] Add test for rebuild after deletion --- components/rebuild/tests/rebuild.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/rebuild/tests/rebuild.rs b/components/rebuild/tests/rebuild.rs index 4d743ab9..10d16936 100644 --- a/components/rebuild/tests/rebuild.rs +++ b/components/rebuild/tests/rebuild.rs @@ -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); 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()); +}