From 7c45f74d11e695b4d5bdaecb649e99d83301210b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Barzowski?= Date: Mon, 13 Apr 2020 21:23:49 +0200 Subject: [PATCH] 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. --- tests/testsuite/conda.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/testsuite/conda.rs b/tests/testsuite/conda.rs index f7c2e71c..2f2bf561 100644 --- a/tests/testsuite/conda.rs +++ b/tests/testsuite/conda.rs @@ -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();