mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-12-30 12:50:37 +00:00
fix: Do not depend on user's config in conda tests (#1098)
The user's config is automatically loaded in context.new_module. This change explicitly sets the empty config to avoid depending on the environment. Without this fix, the tests do not pass for users who have a custom symbol defined for conda. This prevents installing/upgrading from Arch Linux AUR.
This commit is contained in:
parent
05e323da75
commit
7c45f74d11
@ -2,12 +2,14 @@ use ansi_term::Color;
|
||||
use std::io;
|
||||
|
||||
use crate::common;
|
||||
use crate::common::TestCommand;
|
||||
|
||||
#[test]
|
||||
fn not_in_env() -> io::Result<()> {
|
||||
let output = common::render_module("conda")
|
||||
.env_clear()
|
||||
.env("PATH", env!("PATH"))
|
||||
.use_config("".parse().unwrap())
|
||||
.output()?;
|
||||
|
||||
let expected = "";
|
||||
@ -22,6 +24,7 @@ fn env_set() -> io::Result<()> {
|
||||
let output = common::render_module("conda")
|
||||
.env_clear()
|
||||
.env("CONDA_DEFAULT_ENV", "astronauts")
|
||||
.use_config("".parse().unwrap())
|
||||
.output()?;
|
||||
|
||||
let expected = format!("via {} ", Color::Green.bold().paint("C astronauts"));
|
||||
@ -33,7 +36,11 @@ fn env_set() -> io::Result<()> {
|
||||
|
||||
#[test]
|
||||
fn truncate() -> io::Result<()> {
|
||||
let output = common::render_module("conda").env_clear().env("CONDA_DEFAULT_ENV", "/some/really/long/and/really/annoying/path/that/shouldnt/be/displayed/fully/conda/my_env").output()?;
|
||||
let output = common::render_module("conda")
|
||||
.env_clear()
|
||||
.use_config("".parse().unwrap())
|
||||
.env("CONDA_DEFAULT_ENV", "/some/really/long/and/really/annoying/path/that/shouldnt/be/displayed/fully/conda/my_env")
|
||||
.output()?;
|
||||
|
||||
let expected = format!("via {} ", Color::Green.bold().paint("C my_env"));
|
||||
let actual = String::from_utf8(output.stdout).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user