Skip to content

Commit

Permalink
Set env variable for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Aug 21, 2024
1 parent 5536616 commit 78dbbaf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/channel_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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");
}

0 comments on commit 78dbbaf

Please sign in to comment.