From f8ba601721a8407e5ecaf03b0979ce7930457292 Mon Sep 17 00:00:00 2001 From: Ian Rettig Date: Mon, 9 Jun 2025 13:35:16 -0400 Subject: [PATCH] Feat: Add integration test for file not exist. --- tests/cli.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/cli.rs diff --git a/tests/cli.rs b/tests/cli.rs new file mode 100644 index 0000000..69d71bf --- /dev/null +++ b/tests/cli.rs @@ -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> { + 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(()) +}