tests: abuild-keygen: create a fake git

test what happens when git has no user.email configured
This commit is contained in:
Natanael Copa 2021-05-06 13:58:23 +02:00
parent e520288df5
commit b4816004a1
1 changed files with 9 additions and 1 deletions

View File

@ -3,8 +3,16 @@ setup() {
export ABUILD_SHAREDIR="$PWD/.."
tmpdir="$BATS_TMPDIR"/abuild-keygen
export ABUILD_USERDIR="$tmpdir"/user
export PACKAGER="Test User <user@example.com>"
mkdir -p "$ABUILD_USERDIR"
# provide a fake git
mkdir -p "$tmpdir"/bin
cat >"$tmpdir"/bin/git <<-EOF
#!/bin/sh
exit 1
EOF
chmod +x "$tmpdir"/bin/git
export PATH="$tmpdir/bin:$PATH"
}
teardown() {