From c25d668b438d0dc14f72e08633606deda05f8c47 Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Sat, 5 Nov 2022 10:02:59 +0100 Subject: [PATCH] Add Test --- tests/git-auto-commit.bats | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index f0b2324..f85f653 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -37,6 +37,7 @@ setup() { export INPUT_SKIP_CHECKOUT=false export INPUT_DISABLE_GLOBBING=false export INPUT_CREATE_BRANCH=false + export INPUT_INTERNAL_GIT_BINARY=git # Set GitHub environment variables used by the GitHub Action temp_github_output_file=$(mktemp -t github_output_test.XXXXX) @@ -1041,3 +1042,13 @@ cat_github_output() { assert_line "::set-output name=changes_detected::false" refute_line -e "::set-output name=commit_hash::[0-9a-f]{40}$" } + +@test "It fails hard if git is not available" { + INPUT_INTERNAL_GIT_BINARY=binary-does-not-exist + + touch "${FAKE_LOCAL_REPOSITORY}"/new-file-{1,2,3}.txt + + run git_auto_commit + + assert_failure; +}