mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Remove keep_env
from the test framework
This commit is contained in:
parent
cc77a952f5
commit
81a4e8fb7d
10 changed files with 36 additions and 81 deletions
|
@ -1,29 +1,21 @@
|
|||
use crate::common::util::TestScenario;
|
||||
use std::env;
|
||||
|
||||
#[test]
|
||||
fn test_get_all() {
|
||||
let key = "KEY";
|
||||
env::set_var(key, "VALUE");
|
||||
assert_eq!(env::var(key), Ok("VALUE".to_string()));
|
||||
|
||||
TestScenario::new(util_name!())
|
||||
.ucmd()
|
||||
.keep_env()
|
||||
.env("HOME", "FOO")
|
||||
.env("KEY", "VALUE")
|
||||
.succeeds()
|
||||
.stdout_contains("HOME=")
|
||||
.stdout_contains("HOME=FOO")
|
||||
.stdout_contains("KEY=VALUE");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_get_var() {
|
||||
let key = "KEY";
|
||||
env::set_var(key, "VALUE");
|
||||
assert_eq!(env::var(key), Ok("VALUE".to_string()));
|
||||
|
||||
let result = TestScenario::new(util_name!())
|
||||
.ucmd()
|
||||
.keep_env()
|
||||
.env("KEY", "VALUE")
|
||||
.arg("KEY")
|
||||
.succeeds();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue