mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-28 07:46:28 +00:00
Co-authored-by: Thomas Kintscher <thomas@flowciety.de>
This commit is contained in:
parent
441ebb39b9
commit
230e85be37
@ -57,6 +57,10 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
}
|
||||
};
|
||||
|
||||
if ctx == "default" {
|
||||
return None;
|
||||
}
|
||||
|
||||
let parsed = StringFormatter::new(config.format).and_then(|formatter| {
|
||||
formatter
|
||||
.map_meta(|variable, _| match variable {
|
||||
@ -307,6 +311,24 @@ mod tests {
|
||||
cfg_dir.close()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_docker_context_default() -> io::Result<()> {
|
||||
let cfg_dir = tempfile::tempdir()?;
|
||||
|
||||
let actual = ModuleRenderer::new("docker_context")
|
||||
.env("DOCKER_CONTEXT", "default")
|
||||
.config(toml::toml! {
|
||||
[docker_context]
|
||||
only_with_files = false
|
||||
})
|
||||
.collect();
|
||||
let expected = None;
|
||||
|
||||
assert_eq!(expected, actual);
|
||||
|
||||
cfg_dir.close()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_docker_context_overrides_config() -> io::Result<()> {
|
||||
let cfg_dir = tempfile::tempdir()?;
|
||||
|
Loading…
Reference in New Issue
Block a user