Update Tests
This commit is contained in:
parent
9c3e9f4a13
commit
eaeb5b57de
|
@ -874,19 +874,34 @@ git_auto_commit() {
|
|||
}
|
||||
|
||||
@test "expands file patterns correctly and commits all changed files" {
|
||||
# Add more .foo files
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-1.foo
|
||||
# Add more .md files
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-1.md
|
||||
mkdir "${FAKE_LOCAL_REPOSITORY}"/subdirectory/
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/subdirectory/new-file-2.foo
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/subdirectory/new-file-2.md
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-3.bar
|
||||
|
||||
INPUT_FILE_PATTERN="*.foo *.bar"
|
||||
INPUT_FILE_PATTERN="*.md *.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-1.md"
|
||||
assert_line --partial "subdirectory/new-file-2.md"
|
||||
# refute_line --partial "subdirectory/new-file-2.md"
|
||||
assert_line --partial "new-file-3.bar"
|
||||
}
|
||||
|
||||
@test "expands file patterns correctly and commits all changed files if dirty files are only in subdirectory" {
|
||||
# Add more .md files
|
||||
mkdir "${FAKE_LOCAL_REPOSITORY}"/subdirectory/
|
||||
touch "${FAKE_LOCAL_REPOSITORY}"/subdirectory/new-file-2.md
|
||||
|
||||
INPUT_FILE_PATTERN="*.md"
|
||||
|
||||
run git_auto_commit
|
||||
|
||||
assert_success
|
||||
|
||||
assert_line --partial "subdirectory/new-file-2.md"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue