()
| 45 | |
| 46 | impl Env { |
| 47 | pub fn new() -> Self { |
| 48 | if cfg!(test) && !is_integ_test() { |
| 49 | match cfg!(windows) { |
| 50 | true => Env::from_slice(&[ |
| 51 | ("USERPROFILE", ACTIVE_USER_HOME), |
| 52 | ("USERNAME", "testuser"), |
| 53 | ("PATH", ""), |
| 54 | ]), |
| 55 | false => Env::from_slice(&[("HOME", ACTIVE_USER_HOME), ("USER", "testuser"), ("PATH", "")]), |
| 56 | } |
| 57 | } else { |
| 58 | Env(inner::Inner::Real) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /// Create a fake process environment from a slice of tuples. |
| 63 | pub fn from_slice(vars: &[(&str, &str)]) -> Self { |
nothing calls this directly
no test coverage detected