From 9d8a8f0bf4756799eb122c30c8ef157c3bc4dc23 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 5 Sep 2017 22:00:58 +0200 Subject: [PATCH] Fix Store loading in tests: Use in-memory store backend --- lib/entry/libimagentrydatetime/src/datetime.rs | 4 +++- lib/entry/libimagentrygps/src/entry.rs | 4 +++- lib/entry/libimagentrylink/src/internal.rs | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/entry/libimagentrydatetime/src/datetime.rs b/lib/entry/libimagentrydatetime/src/datetime.rs index 06d11b07..420f65f0 100644 --- a/lib/entry/libimagentrydatetime/src/datetime.rs +++ b/lib/entry/libimagentrydatetime/src/datetime.rs @@ -223,7 +223,9 @@ mod tests { use chrono::naive::NaiveTime; pub fn get_store() -> Store { - Store::new(PathBuf::from("/"), None).unwrap() + use libimagstore::store::InMemoryFileAbstraction; + let backend = Box::new(InMemoryFileAbstraction::new()); + Store::new_with_backend(PathBuf::from("/"), None, backend).unwrap() } #[test] diff --git a/lib/entry/libimagentrygps/src/entry.rs b/lib/entry/libimagentrygps/src/entry.rs index 0a4bcf7d..e3072a26 100644 --- a/lib/entry/libimagentrygps/src/entry.rs +++ b/lib/entry/libimagentrygps/src/entry.rs @@ -67,7 +67,9 @@ mod tests { } fn get_store() -> Store { - Store::new(PathBuf::from("/"), None).unwrap() + use libimagstore::file_abstraction::InMemoryFileAbstraction; + let backend = Box::new(InMemoryFileAbstraction::new()); + Store::new_with_backend(PathBuf::from("/"), None, backend).unwrap() } #[test] diff --git a/lib/entry/libimagentrylink/src/internal.rs b/lib/entry/libimagentrylink/src/internal.rs index b5b0fd37..5b1ea8c9 100644 --- a/lib/entry/libimagentrylink/src/internal.rs +++ b/lib/entry/libimagentrylink/src/internal.rs @@ -800,7 +800,9 @@ mod test { } pub fn get_store() -> Store { - Store::new(PathBuf::from("/"), None).unwrap() + use libimagstore::file_abstraction::InMemoryFileAbstraction; + let backend = Box::new(InMemoryFileAbstraction::new()); + Store::new_with_backend(PathBuf::from("/"), None, backend).unwrap() } #[test]