-
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.
The configuration will start from `acquire-git` command and guide a user through the process interactively. If standards are configured, they will be printed to CLI instead of reconfiguring. During the installation, `acquire-git` will be executed instead of providing the instructions. This allows updating settings for the new versions automatically. Now, the `read` addon supports partial mocking of the answers correctly. This works because a replay variable is always set with either provided value or empty value. #177
- Loading branch information
Showing
11 changed files
with
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ pipeline() { | |
.workflows/bats-pipeline.bash || fail "Unit tests are failed." | ||
( | ||
echo "Installation...." | ||
git config --global user.name "Elegant Git" | ||
git config --global user.email [email protected] | ||
git config --global core.editor some-editor | ||
git config --global elegant.acquired true | ||
./install.bash /usr/local src | ||
echo "'Unknown command' testing..." | ||
git elegant unknown-command | grep "Unknown command: git elegant unknown-command" | ||
|
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
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
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 |
---|---|---|
|
@@ -7,11 +7,13 @@ load addons-repo | |
|
||
setup() { | ||
repo-new | ||
read-answer "y" | ||
} | ||
|
||
teardown() { | ||
fake-clean | ||
repo-clean | ||
read-clean | ||
} | ||
|
||
@test "'acquire-git': all configurations work as expected" { | ||
|
@@ -21,6 +23,7 @@ teardown() { | |
|
||
@test "'acquire-git': basics are configured as expected" { | ||
check git-elegant acquire-git | ||
[[ "${lines[@]}" =~ "Please hit enter if you wish {default value}." ]] | ||
[[ "${lines[@]}" =~ "What is your user name? {Elegant Git}: " ]] | ||
[[ "${lines[@]}" =~ "==>> git config --global user.name Elegant Git" ]] | ||
[[ "${lines[@]}" =~ "What is your user email? {[email protected]}: " ]] | ||
|
@@ -93,3 +96,23 @@ teardown() { | |
[[ "$status" -eq 0 ]] | ||
[[ "${lines[@]}" =~ "2 Elegant Git aliases were removed." ]] | ||
} | ||
|
||
@test "'acquire-git': a message is displayed if global configuration is disabled" { | ||
read-clean | ||
read-answer "n" | ||
check git-elegant acquire-git | ||
[[ "$status" -eq 0 ]] | ||
[[ "${lines[@]}" =~ "You've decided to stay with local configurations. Great!" ]] | ||
} | ||
|
||
@test "'acquire-git': the basics are not changed if they are already configured" { | ||
repo git config --global user.name aaaa | ||
repo git config --global user.email aaaa | ||
repo git config --global core.editor aaaa | ||
check git-elegant acquire-git | ||
[[ "$status" -eq 0 ]] | ||
[[ "${lines[@]}" =~ "==>> git config --global user.name aaaa" ]] | ||
[[ "${lines[@]}" =~ "==>> git config --global user.email aaaa" ]] | ||
[[ "${lines[@]}" =~ "==>> git config --global core.editor aaaa" ]] | ||
[[ ! "${lines[@]}" =~ "Please hit enter if you wish {default value}." ]] | ||
} |
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 |
---|---|---|
|
@@ -29,7 +29,14 @@ repository() { | |
info-text "Init repository..." | ||
docker exec -it repository bash -c "source /eg/tests/addons-repo.bash;source /eg/tests/addons-common.bash; repo-new" | ||
info-text "Install Elegant Git..." | ||
docker exec -it repository bash -c "cd /eg; ./install.bash /usr/local src" | ||
docker exec -it repository bash -c " | ||
cd /eg | ||
git config --global user.name \"Elegant Git\" | ||
git config --global user.email [email protected] | ||
git config --global core.editor some-editor | ||
git config --global elegant.acquired true | ||
./install.bash /usr/local src | ||
" | ||
info-text "Ready! Enjoy experiments..." | ||
docker attach repository | ||
} | ||
|