Feat: Add integration test for file not exist.

This commit is contained in:
Ian Rettig
2025-06-09 13:35:16 -04:00
parent 1841e2287a
commit f8ba601721
+15
View File
@@ -0,0 +1,15 @@
use assert_cmd::prelude::*; // Add methods on commands
use predicates::prelude::*; // Used for writing assertions
use std::process::Command; // Run programs
#[test]
fn file_doesnt_exist() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("grrs")?;
cmd.arg("foobar").arg("test/file/doesnt/exist");
cmd.assert()
.failure()
.stderr(predicate::str::contains("could not read file"));
Ok(())
}