nushell/crates/nu-cli/tests/commands/with_env.rs
Jonathan Turner c06a692709
Bash-like shorthand with-env (#1718)
* Bash-like shorthand with-env

* fix clippy warning
2020-05-06 18:57:37 +12:00

22 lines
416 B
Rust

use nu_test_support::nu;
#[test]
fn with_env_extends_environment() {
let actual = nu!(
cwd: "tests/fixtures/formats",
"with-env [FOO BARRRR] {echo $nu.env} | get FOO"
);
assert_eq!(actual, "BARRRR");
}
#[test]
fn with_env_shorthand() {
let actual = nu!(
cwd: "tests/fixtures/formats",
"FOO=BARRRR echo $nu.env | get FOO"
);
assert_eq!(actual, "BARRRR");
}