summary refs log tree commit diff stats
path: root/src/logging.rs
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-05-27 00:34:32 -0400
committerBen Morrison <ben@gbmor.dev>2020-05-27 00:34:32 -0400
commit8fbced879b44d65fcf0e59f6ffa3e6c6d4453d6c (patch)
treeabecc2fa87e0aab23d6b9a16f0a9eef98a74834b /src/logging.rs
parent9aaaedcb99227f3ad910057d48568c6b142ced9e (diff)
downloadclinte-8fbced879b44d65fcf0e59f6ffa3e6c6d4453d6c.tar.gz
added test for tempfile creation
Diffstat (limited to 'src/logging.rs')
-rw-r--r--src/logging.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/logging.rs b/src/logging.rs
index d748117..88d9f80 100644
--- a/src/logging.rs
+++ b/src/logging.rs
@@ -21,6 +21,7 @@ fn init(path: &str) -> error::Result<()> {
 mod tests {
     use super::*;
 
+    use crate::user;
     use std::fs;
 
     #[test]
@@ -36,4 +37,15 @@ mod tests {
 
         fs::remove_file("clinte_test.log").unwrap();
     }
+
+    #[test]
+    #[ignore]
+    fn checked_init_logs() {
+        checked_init();
+        log::info!("CHECKED INIT TEST");
+
+        let path = format!("/tmp/clinte_{}.log", *user::NAME);
+        let logfile = fs::read_to_string(&path).unwrap();
+        assert!(logfile.contains("CHECKED INIT TEST"));
+    }
 }