From 4c67450b0c05eec5ce091b11575ad9b422848306 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 12 Oct 2019 17:03:03 +0200 Subject: [PATCH] Add test: store is empty after creation Signed-off-by: Matthias Beyer --- tests/ui/src/imag_init.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/ui/src/imag_init.rs b/tests/ui/src/imag_init.rs index 2ef6aec3..736546b7 100644 --- a/tests/ui/src/imag_init.rs +++ b/tests/ui/src/imag_init.rs @@ -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"); +} +