feat: Add prefix config to directory module (#642)

This commit is contained in:
Dan Wendorf
2019-12-06 11:19:11 -08:00
committed by Matan Kushner
parent 9f574eaabd
commit dee25c7b35
10 changed files with 28 additions and 3 deletions
+16
View File
@@ -95,6 +95,22 @@ fn root_directory() -> io::Result<()> {
Ok(())
}
#[test]
fn test_prefix() -> io::Result<()> {
let output = common::render_module("directory")
.arg("--path=/")
.use_config(toml::toml! {
[directory]
prefix = "sample "
})
.output()?;
let actual = String::from_utf8(output.stdout).unwrap();
let expected = format!("sample {} ", Color::Cyan.bold().paint("/"));
assert_eq!(expected, actual);
Ok(())
}
#[test]
#[cfg(not(target_os = "windows"))]
fn directory_in_root() -> io::Result<()> {