-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more mandatory configurations to
acquire-repository
command
The added configuration options are required for good work of Elegant git. Also, they are platform-specific which make the tool a cross-platform one.
- Loading branch information
Showing
6 changed files
with
111 additions
and
24 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ init-repo() { | |
testtee git init | ||
testtee git config --local user.email "\"[email protected]\"" | ||
testtee git config --local user.name "\"Elegant Git\"" | ||
testtee git config --local core.editor "\"edi\"" | ||
testtee touch $FILE_TO_MODIFY | ||
testtee git add . | ||
testtee git commit -m "\"Add $FILE_TO_MODIFY\"" | ||
|
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 |
---|---|---|
|
@@ -5,11 +5,6 @@ load addons-read | |
load addons-fake | ||
load addons-git | ||
|
||
fake-preconditions() { | ||
fake-pass git "config user.name" "UserName" | ||
fake-pass git "config user.email" "UserEmail" | ||
|
||
} | ||
setup() { | ||
init-repo | ||
} | ||
|
@@ -21,20 +16,62 @@ teardown() { | |
|
||
@test "'acquire-repository': all configurations work as expected" { | ||
check git-elegant acquire-repository | ||
[[ ${#lines[@]} -eq 35 ]] | ||
[[ "${status}" -eq 0 ]] | ||
} | ||
|
||
@test "'acquire-repository': interactive configuration works as expected" { | ||
check git-elegant acquire-repository | ||
[[ "${lines[@]}" =~ "What is your user name? {Elegant Git}: " ]] | ||
[[ "${lines[@]}" =~ "== git config --local user.name Elegant Git ==" ]] | ||
[[ "${lines[@]}" =~ "What is your user email? {[email protected]}: " ]] | ||
[[ "${lines[@]}" =~ "== git config --local user.email [email protected] ==" ]] | ||
[[ "${lines[@]}" =~ "Please specify a command to start the editor. {edi}: " ]] | ||
[[ "${lines[@]}" =~ "== git config --local core.editor edi ==" ]] | ||
} | ||
|
||
@test "'acquire-repository': mandatory configuration works as expected on Windows" { | ||
fake-pass uname -s Windows | ||
check git-elegant acquire-repository | ||
[[ "${lines[@]}" =~ "== git config --local core.commentChar | ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local apply.whitespace fix ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.prune true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.pruneTags true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local core.autocrlf true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local pull.rebase true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local rebase.autoStash true ==" ]] | ||
# negative checks are used instead of checking commands size | ||
[[ ! "${lines[@]}" =~ "== git config --local credential.helper osxkeychain ==" ]] | ||
[[ ! "${lines[@]}" =~ "== git config --local core.autocrlf input ==" ]] | ||
} | ||
|
||
@test "'acquire-repository': mandatory configuration works as expected on Linux" { | ||
fake-pass uname -s Linux | ||
check git-elegant acquire-repository | ||
[[ "${lines[@]}" =~ "== git config --local core.commentChar | ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local apply.whitespace fix ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.prune true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.pruneTags true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local core.autocrlf input ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local pull.rebase true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local rebase.autoStash true ==" ]] | ||
# negative checks are used instead of checking commands size | ||
[[ ! "${lines[@]}" =~ "== git config --local credential.helper osxkeychain ==" ]] | ||
[[ ! "${lines[@]}" =~ "== git config --local core.autocrlf true ==" ]] | ||
} | ||
|
||
@test "'acquire-repository': mandatory configuration works as expected" { | ||
@test "'acquire-repository': mandatory configuration works as expected on Darwin" { | ||
fake-pass uname -s Darwin | ||
check git-elegant acquire-repository | ||
[[ "${lines[@]}" =~ "== git config --local core.commentChar | ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local apply.whitespace fix ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.prune true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local fetch.pruneTags true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local core.autocrlf input ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local pull.rebase true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local rebase.autoStash true ==" ]] | ||
[[ "${lines[@]}" =~ "== git config --local credential.helper osxkeychain ==" ]] | ||
# negative checks are used instead of checking commands size | ||
[[ ! "${lines[@]}" =~ "== git config --local core.autocrlf true ==" ]] | ||
} | ||
|
||
@test "'acquire-repository': aliases configuration works as expected" { | ||
|