From 4846a7c501794f4c8e3ee87e65248fc33565052e Mon Sep 17 00:00:00 2001 From: Tamo Date: Thu, 15 Sep 2022 13:34:02 +0200 Subject: [PATCH] use faux in the file-store --- file-store/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/file-store/src/lib.rs b/file-store/src/lib.rs index 58067962a..e983aa115 100644 --- a/file-store/src/lib.rs +++ b/file-store/src/lib.rs @@ -31,20 +31,23 @@ impl DerefMut for File { } } -// #[cfg_attr(test, faux::create)] +#[cfg_attr(test, faux::create)] #[derive(Clone, Debug)] pub struct FileStore { path: PathBuf, } -// #[cfg_attr(test, faux::methods)] +#[cfg(not(test))] impl FileStore { pub fn new(path: impl AsRef) -> Result { let path = path.as_ref().join(UPDATE_FILES_PATH); std::fs::create_dir_all(&path)?; Ok(FileStore { path }) } +} +#[cfg_attr(test, faux::methods)] +impl FileStore { /// Creates a new temporary update file. /// A call to `persist` is needed to persist the file in the database. pub fn new_update(&self) -> Result<(Uuid, File)> {