From 5973de3a73b029ed81c72db57d323c81f6ea79a1 Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 23 Oct 2021 19:05:15 +0200 Subject: [PATCH] Avoids using tempfile in tests Not useful --- server/Cargo.toml | 3 --- server/src/main.rs | 10 ++++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/server/Cargo.toml b/server/Cargo.toml index bb515411..2bb5fd6b 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -18,6 +18,3 @@ oxigraph = { version = "0.3.0-dev", path = "../lib", features = ["http_client"] rand = "0.8" url = "2" oxiri = "0.1" - -[dev-dependencies] -tempfile = "3" diff --git a/server/src/main.rs b/server/src/main.rs index 05fcef7e..a9370d99 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -929,7 +929,6 @@ impl Write for ReadForWriteWriter { mod tests { use super::*; use oxhttp::model::Method; - use tempfile::{tempdir, TempDir}; #[test] fn get_ui() { @@ -1432,14 +1431,13 @@ mod tests { struct ServerTest { store: Store, - _path: TempDir, } impl ServerTest { - fn new() -> ServerTest { - let path = tempdir().unwrap(); - let store = Store::open(path.path()).unwrap(); - ServerTest { _path: path, store } + fn new() -> Self { + Self { + store: Store::new().unwrap(), + } } fn exec(&self, mut request: Request) -> Response {