Add test: store is empty after creation

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-10-12 17:03:03 +02:00
parent eb6029537a
commit 4c67450b0c

View file

@ -94,3 +94,17 @@ fn test_init_creates_store_directory() {
assert!(store_path.exists(), "imag store path does not exist");
}
#[test]
fn test_init_creates_empty_store_directory() {
crate::setup_logging();
let imag_home = crate::imag::make_temphome();
call(&imag_home);
let store_path = {
let mut path = imag_home.path().to_path_buf();
path.push("store");
path
};
assert_eq!(0, std::fs::read_dir(store_path).unwrap().count(), "imag store directory is not empty after creation");
}