summary refs log tree commit diff
path: root/tests/no_repo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/no_repo.rs')
-rw-r--r--tests/no_repo.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/no_repo.rs b/tests/no_repo.rs
new file mode 100644
index 0000000..247426c
--- /dev/null
+++ b/tests/no_repo.rs
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: EUPL-1.2
+// SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
+
+use std::process::Command;
+
+#[test]
+fn no_repo() {
+    let output = Command::new(env!("CARGO_BIN_EXE_git-girf"))
+        .current_dir("/var/empty")
+        .env_clear()
+        .output()
+        .expect("spawn");
+
+    assert_eq!(output.status.code(), Some(128));
+    assert_eq!(
+        output.stderr,
+        b"fatal: could not find repository from '.'\n"
+    );
+    assert_eq!(output.stdout, b"");
+}