2020-05-06 05:56:31 +02:00
|
|
|
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"
|
|
|
|
);
|
|
|
|
|
2020-05-07 13:03:43 +02:00
|
|
|
assert_eq!(actual.out, "BARRRR");
|
2020-05-06 05:56:31 +02:00
|
|
|
}
|
2020-05-06 08:57:37 +02:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn with_env_shorthand() {
|
|
|
|
let actual = nu!(
|
|
|
|
cwd: "tests/fixtures/formats",
|
|
|
|
"FOO=BARRRR echo $nu.env | get FOO"
|
|
|
|
);
|
|
|
|
|
2020-05-07 13:03:43 +02:00
|
|
|
assert_eq!(actual.out, "BARRRR");
|
2020-05-06 08:57:37 +02:00
|
|
|
}
|