From 9d15eb135b7f02662fa5df1a680b635f29d2515b Mon Sep 17 00:00:00 2001 From: David Knaack Date: Wed, 31 Mar 2021 18:00:24 +0200 Subject: [PATCH] test(directory): fix on windows without admin (#2497) --- src/modules/directory.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/modules/directory.rs b/src/modules/directory.rs index 9b154a82..35e1d6c2 100644 --- a/src/modules/directory.rs +++ b/src/modules/directory.rs @@ -683,14 +683,14 @@ mod tests { #[test] fn root_directory() { - let actual = ModuleRenderer::new("directory").path("/").collect(); - #[cfg(not(target_os = "windows"))] - let expected = Some(format!( - "{}{} ", - Color::Cyan.bold().paint("/"), - Color::Red.normal().paint("🔒") - )); - #[cfg(target_os = "windows")] + let actual = ModuleRenderer::new("directory") + .config(toml::toml! { + [directory] + read_only = "" + read_only_style = "" + }) + .path("/") + .collect(); let expected = Some(format!("{} ", Color::Cyan.bold().paint("/"))); assert_eq!(expected, actual); @@ -1466,6 +1466,8 @@ mod tests { [directory] use_logical_path = false truncation_length = 0 + read_only = "" + read_only_style = "" }) .path(sys32_path) .collect();