Skip to content

Commit

Permalink
Remove long-unused autoenv tests (nushell#14436)
Browse files Browse the repository at this point in the history
# Description

The `.nu-env` file feature was removed some time ago (probably in the
engine-q upgrade?). The tests, however, still remained as dead-code, so
this is just some basic clean-up.

If this feature was ever implemented again, the tests would need to be
rewritten anyway due to the changes in the way config is handled.

# User-Facing Changes

None

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
- 
# After Submitting

N/A
  • Loading branch information
NotTheDr01ds authored Nov 26, 2024
1 parent 7a9b14b commit ac75562
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 715 deletions.
26 changes: 0 additions & 26 deletions tests/shell/environment/env.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use super::support::Trusted;

use nu_test_support::fs::Stub::FileWithContent;
use nu_test_support::playground::Playground;
use nu_test_support::{nu, nu_repl_code, nu_with_std};
use pretty_assertions::assert_eq;
use serial_test::serial;

#[test]
fn env_shorthand() {
Expand Down Expand Up @@ -157,29 +154,6 @@ fn has_file_loc() {
})
}

// FIXME: autoenv not currently implemented
#[ignore]
#[test]
#[serial]
fn passes_env_from_local_cfg_to_external_process() {
Playground::setup("autoenv_dir", |dirs, sandbox| {
sandbox.with_files(&[FileWithContent(
".nu-env",
r#"[env]
FOO = "foo"
"#,
)]);

let actual = Trusted::in_path(&dirs, || {
nu!(cwd: dirs.test(), "
nu --testbin echo_env FOO
")
});

assert_eq!(actual.out, "foo");
})
}

#[test]
fn hides_env_in_block() {
let inp = &[
Expand Down
21 changes: 0 additions & 21 deletions tests/shell/environment/mod.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
mod env;

// FIXME: nu_env tests depend on autoenv which hasn't been ported yet
// mod nu_env;

pub mod support {
use nu_test_support::{nu, playground::*, Outcome};

pub struct Trusted;

impl Trusted {
pub fn in_path(dirs: &Dirs, block: impl FnOnce() -> Outcome) -> Outcome {
let for_env_manifest = dirs.test().to_string_lossy();

nu!(cwd: dirs.root(), "autoenv trust \"{}\"", for_env_manifest);
let out = block();
nu!(cwd: dirs.root(), "autoenv untrust \"{}\"", for_env_manifest);

out
}
}
}
Loading

0 comments on commit ac75562

Please sign in to comment.