MCPcopy Index your code
hub / github.com/assert-rs/assert_cmd / env

Method env

src/cmd.rs:318–325  ·  view source on GitHub ↗

Inserts or updates an environment variable mapping. Note that environment variable names are case-insensitive (but case-preserving) on Windows, and case-sensitive on all other platforms. # Examples Basic usage: ```no_run use assert_cmd::Command; Command::new("ls") .env("PATH", "/bin") .unwrap_err(); ```

(&mut self, key: K, val: V)

Source from the content-addressed store, hash-verified

316 /// .unwrap_err();
317 /// ```
318 pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Self
319 where
320 K: AsRef<ffi::OsStr>,
321 V: AsRef<ffi::OsStr>,
322 {
323 self.cmd.env(key, val);
324 self
325 }
326
327 /// Adds or updates multiple environment variable mappings.
328 ///

Callers 9

cargo_binaryFunction · 0.80
stdout_stringFunction · 0.80
failure_exampleFunction · 0.80
code_exampleFunction · 0.80
stdout_exampleFunction · 0.80
stderr_exampleFunction · 0.80
lib_exampleFunction · 0.80
timeout_exampleFunction · 0.80

Calls

no outgoing calls

Tested by 9

cargo_binaryFunction · 0.64
stdout_stringFunction · 0.64
failure_exampleFunction · 0.64
code_exampleFunction · 0.64
stdout_exampleFunction · 0.64
stderr_exampleFunction · 0.64
lib_exampleFunction · 0.64
timeout_exampleFunction · 0.64