fix prompts on startup (#3056)

* fix prompts on startup

* Try again
This commit is contained in:
Jonathan Turner
2021-02-15 20:14:16 +13:00
committed by GitHub
parent c3d2c61729
commit b202951c1d
6 changed files with 109 additions and 214 deletions

View File

@@ -220,6 +220,51 @@ fn autoenv() {
})
}
// #[cfg(feature = "which")]
// #[test]
// fn nu_let_env_overwrites() {
// Playground::setup("syncs_env_test_1", |dirs, sandbox| {
// sandbox.with_files(vec![FileWithContent(
// "configuration.toml",
// r#"
// [env]
// SHELL = "/usr/bin/you_already_made_the_nu_choice"
// "#,
// )]);
// let mut file = dirs.test().clone();
// file.push("configuration.toml");
// let fake_config = FakeConfig::new(&file);
// let mut actual = EnvironmentSyncer::new();
// actual.set_config(Box::new(fake_config));
// // Here, the environment variables from the current session
// // are cleared since we will load and set them from the
// // configuration file (if any)
// actual.clear_env_vars(&mut ctx);
// // Nu loads the environment variables from the configuration file (if any)
// actual.load_environment();
// // By this point, Nu has already loaded the environment variables
// // stored in the configuration file. Before continuing we check
// // if any new environment variables have been added from the ones loaded
// // in the configuration file.
// //
// // Nu sees the missing "USER" variable and accounts for it.
// actual.sync_env_vars(&mut ctx);
// let actual = nu!(
// cwd: dirs.test(),
// r#"let-env SHELL = bob
// echo $nu.env.SHELL
// "#
// );
// assert!(actual.out.ends_with("set_in_foo"))
// });
// }
#[test]
fn invocation_properly_redirects() {
let actual = nu!(