Set up the git repository in the bats file instead

This commit is contained in:
Sven van Heugten 2026-03-02 20:18:09 +01:00
parent e48e27fb52
commit f5f05c0a9e
No known key found for this signature in database
GPG key ID: D612F88666F4F660
2 changed files with 6 additions and 5 deletions

View file

@ -38,11 +38,6 @@ resholve.mkDerivation {
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
shellcheck bin/git-check-assertions test/git-check-assertions.bats shellcheck bin/git-check-assertions test/git-check-assertions.bats
git init
git config user.email test
git config user.name test
git checkout -b main
git commit --allow-empty -m "initial"
./test/git-check-assertions.bats ./test/git-check-assertions.bats
runHook postCheck runHook postCheck
''; '';

View file

@ -6,9 +6,15 @@ setup() {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
PATH="$DIR/../bin:$PATH" PATH="$DIR/../bin:$PATH"
git init
git config user.email "john.doe@example.com"
git config user.name "John Doe"
git checkout -b main
} }
@test "can run" { @test "can run" {
git commit --allow-empty -m "Initial"
run git-check-assertions run git-check-assertions
assert_success assert_success
} }