From d5b54a75d3ee4adba3e46f7a9e27ae67b254418f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 30 Jul 2023 15:30:09 +0100 Subject: [PATCH] add test_util stubs for file open and append_line --- src/test_utils.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test_utils.rs b/src/test_utils.rs index f73b782..2dfbe94 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -8,6 +8,7 @@ use tempfile::{tempdir, TempDir}; use crate::{ errors::Error, + file::{FileAppendLineFn, FileOpenFn}, network::{NetworkDownloadAsMp3Fn, NetworkFetchAsBytesFn, NetworkFetchAsTextFn}, prelude::*, }; @@ -45,3 +46,9 @@ pub fn stub_fetch_as_bytes() -> NetworkFetchAsBytesFn { pub fn stub_download_as_mp3() -> NetworkDownloadAsMp3Fn { Box::new(|_url: &str| Err(Error::message("Not implemented"))) } +pub fn stub_file_open() -> FileOpenFn { + Box::new(|_path: &str| Err(Error::message("Not implemented"))) +} +pub fn stub_file_append_line() -> FileAppendLineFn { + Box::new(|_: &str, _: &str| Err(Error::message("Not implemented"))) +}