From 9c3e9f4a131ff34ff92f5235ccb3229d1196f14d Mon Sep 17 00:00:00 2001 From: Stefan Zweifel Date: Wed, 14 Sep 2022 19:05:25 +0200 Subject: [PATCH] Add Failing Test --- tests/git-auto-commit.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/git-auto-commit.bats b/tests/git-auto-commit.bats index 775d24a..1223163 100644 --- a/tests/git-auto-commit.bats +++ b/tests/git-auto-commit.bats @@ -872,3 +872,21 @@ git_auto_commit() { assert_failure; } + +@test "expands file patterns correctly and commits all changed files" { + # Add more .foo files + touch "${FAKE_LOCAL_REPOSITORY}"/new-file-1.foo + mkdir "${FAKE_LOCAL_REPOSITORY}"/subdirectory/ + touch "${FAKE_LOCAL_REPOSITORY}"/subdirectory/new-file-2.foo + touch "${FAKE_LOCAL_REPOSITORY}"/new-file-3.bar + + INPUT_FILE_PATTERN="*.foo *.bar" + + run git_auto_commit + + assert_success + + assert_line --partial "new-file-1.foo" + assert_line --partial "subdirectory/new-file-2.foo" + assert_line --partial "new-file-3.bar" +}