mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat: Add prefix config to directory module (#642)
This commit is contained in:
committed by
Matan Kushner
parent
9f574eaabd
commit
dee25c7b35
@@ -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<()> {
|
||||
|
||||
Reference in New Issue
Block a user