Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(output): add capability to show scope section
- Loading branch information
1 parent
e8d1d1e
commit d3135ca
Showing
3 changed files
with
107 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
load fixtures/setup_file.sh | ||
|
||
setup() { | ||
cd $BATS_TEST_TMPDIR | ||
} | ||
|
||
@test "show_scope should works" { | ||
echo 'show_scope=1'> ${BATS_TEST_TMPDIR}/.git-changelog | ||
git init | ||
git commit --allow-empty -m"fix(config): add fix" | ||
git_commit+=($(git rev-parse --short HEAD)) | ||
git commit --allow-empty -m"feat(test): add feat" | ||
git_commit+=($(git rev-parse --short HEAD)) | ||
git commit --allow-empty -m"feat: add feat" | ||
git_commit+=($(git rev-parse --short HEAD)) | ||
run git-changelog | ||
[ "$output" == "${BATS_TEST_TMPDIR}/CHANGELOG.md updated !" ] | ||
diff "${BATS_TEST_TMPDIR}/CHANGELOG.md" <(cat <<EOF | ||
# CHANGELOG | ||
## Unreleased | ||
### feat | ||
#### no scope | ||
- add feat (${git_commit[2]}) | ||
#### test | ||
- add feat (${git_commit[1]}) | ||
### fix | ||
#### config | ||
- add fix (${git_commit[0]}) | ||
EOF | ||
) | ||
} |