We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bd27265 commit da6c0adCopy full SHA for da6c0ad
tests/cli.rs
@@ -314,4 +314,16 @@ fn test_add_with_process() -> Result<(), Box<dyn std::error::Error>> {
314
Ok(())
315
}
316
317
-// TODO: add tests for commands with --global flag
+#[test]
318
+/// Test for print command with custom format
319
+fn print_with_custom_format() -> Result<(), Box<dyn std::error::Error>> {
320
+ let mut cmd = Command::cargo_bin("envfetch")?;
321
+ unsafe { env::set_var("FORMAT_TEST", "Hello") };
322
+ cmd.arg("print")
323
+ .arg("--format")
324
+ .arg("{name}={value}")
325
+ .assert()
326
+ .success()
327
+ .stdout(predicate::str::contains("FORMAT_TEST=Hello"));
328
+ Ok(())
329
+}
0 commit comments