From 256ac9c8eb8775acd1f812ee4345e13926181f0e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 12 Aug 2021 11:24:06 +0000 Subject: Find repository --- tests/no_repo.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/no_repo.rs (limited to 'tests/no_repo.rs') 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 + +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""); +} -- cgit 1.4.1