From 78dbbafad80daea355b0217fd2fdb4827e9400f4 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:55:26 -0300 Subject: [PATCH] Set env variable for tests --- tests/channel_selection.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/channel_selection.rs b/tests/channel_selection.rs index c490696c..e73322f9 100644 --- a/tests/channel_selection.rs +++ b/tests/channel_selection.rs @@ -4,6 +4,7 @@ use anyhow::Result; use juliaup::config_file::{load_config_db, JuliaupConfigChannel}; use juliaup::global_paths::get_paths; use normpath::PathExt; +use std::env; use std::path::PathBuf; // Simpler reimplementation of get_julia_path_from_channel from julialauncher.rs to help link channels @@ -178,6 +179,9 @@ fn channel_selection() { .failure(); // Test that completion works only when it should for words + env::set_var("JULIAUP_DEPOT_PATH", depot_dir.path()); + env::set_var("JULIA_DEPOT_PATH", depot_dir.path()); + let linked_julia_path = get_julia_path_from_channel("1.6.7").unwrap(); let linked_julia_version = linked_julia_path.to_str().unwrap(); Command::cargo_bin("juliaup") @@ -217,4 +221,7 @@ fn channel_selection() { .env("JULIAUP_DEPOT_PATH", depot_dir.path()) .assert() .failure(); + + env::remove_var("JULIAUP_DEPOT_PATH"); + env::remove_var("JULIA_DEPOT_PATH"); }