-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88615ce
commit de55275
Showing
6 changed files
with
304 additions
and
76 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
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,66 @@ | ||
# shellcheck shell=bash | ||
|
||
source "$BATS_TEST_DIRNAME/test_util.sh" | ||
|
||
setup_file() { | ||
test_util.setup_file | ||
} | ||
|
||
setup() { | ||
test_util.cd_test | ||
|
||
git init | ||
printf '%s\n' 'data' > tmpfile | ||
git add . | ||
git commit -m 'test: add data' | ||
git tag 0.1.0 -m 'bump: 0.1.0' | ||
} | ||
|
||
@test "archive file on tags branch" { | ||
git checkout -b tags0.1.0 | ||
run git archive-file | ||
assert_success | ||
|
||
local describe_output= | ||
describe_output=$(git describe) | ||
assert_file_exists "${PWD##*/}.$describe_output.zip" | ||
} | ||
|
||
@test "archive file on any not tags branch without default branch" { | ||
git checkout -b not-tags-branch | ||
run git archive-file | ||
assert_success | ||
|
||
local describe_output= | ||
describe_output=$(git describe --always --long) | ||
assert_file_exists "${PWD##*/}.$describe_output.not-tags-branch.zip" | ||
} | ||
|
||
@test "archive file on any not tags branch with default branch" { | ||
skip "Not working as expected" | ||
|
||
run git archive-file | ||
assert_success | ||
|
||
local describe_output= | ||
describe_output=$(git describe --always --long) | ||
assert_file_exists "${PWD##*/}.$describe_output.zip" | ||
} | ||
|
||
@test "archive file on branch name has slash" { | ||
git checkout -b feature/slash | ||
run git archive-file | ||
assert_success | ||
|
||
local describe_output= | ||
describe_output=$(git describe --always --long) | ||
assert_file_exists "${PWD##*/}.$describe_output.feature-slash.zip" | ||
} | ||
|
||
@test "archive file on dirname has backslash" { | ||
skip | ||
} | ||
|
||
@test "archive file on tag name has slash" { | ||
skip | ||
} |
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,52 @@ | ||
# shellcheck shell=bash | ||
|
||
source "$BATS_TEST_DIRNAME/test_util.sh" | ||
|
||
|
||
setup_file() { | ||
test_util.setup_file | ||
} | ||
|
||
setup() { | ||
test_util.cd_test | ||
|
||
git init | ||
git config --local user.name test | ||
git config --local user.email [email protected] | ||
printf '%s\n' 'A' > tmpfile | ||
git add . | ||
git commit -m 'test: add data A' | ||
git config --local user.name testagain | ||
git config --local user.email [email protected] | ||
printf '%s\n' 'B' > tmpfile | ||
git add . | ||
git commit -m 'test: add data B' | ||
} | ||
|
||
@test "output authors has email without any parameter" { | ||
run git authors | ||
assert_success | ||
|
||
local content=$(<AUTHORS) | ||
assert_equal "$content" $'test <[email protected]>\ntestagain <[email protected]>' | ||
} | ||
|
||
@test "list authors has email defaultly" { | ||
run git authors --list | ||
assert_output $'test <[email protected]>\ntestagain <[email protected]>' | ||
assert_success | ||
|
||
run git authors -l | ||
assert_output $'test <[email protected]>\ntestagain <[email protected]>' | ||
assert_success | ||
} | ||
|
||
@test "list authors has no email" { | ||
run git authors --list --no-email | ||
assert_output $'test\ntestagain' | ||
assert_success | ||
|
||
run git authors -l --no-email | ||
assert_output $'test\ntestagain' | ||
assert_success | ||
} |
Oops, something went wrong.