@@ -18,73 +18,73 @@ teardown() {
18
18
19
19
@test " 'acquire-git': all configurations work as expected" {
20
20
check git-elegant acquire-git
21
- [[ " ${status} " -eq 0 ]]
21
+ [[ ${status} -eq 0 ]]
22
22
}
23
23
24
24
@test " 'acquire-git': basics are configured as expected" {
25
25
check git-elegant acquire-git
26
- [[ " ${lines[@]} " =~ " Please hit enter if you wish {default value}." ]]
27
- [[ " ${lines[@]} " =~ " What is your user name? {Elegant Git}: " ]]
28
- [[ " ${lines[@]} " =~ " ==>> git config --global user.name Elegant Git" ]]
29
- [[
" ${lines[@]} " =~ " What is your user email? {[email protected] }: " ]]
30
- [[
" ${lines[@]} " =~ " ==>> git config --global user.email [email protected] " ]]
31
- [[ " ${lines[@]} " =~ " Please specify a command to start the editor. {vi}: " ]]
32
- [[ " ${lines[@]} " =~ " ==>> git config --global core.editor vi" ]]
26
+ [[ ${lines[@]} =~ " Please hit enter if you wish {default value}." ]]
27
+ [[ ${lines[@]} =~ " What is your user name? {Elegant Git}: " ]]
28
+ [[ ${lines[@]} =~ " ==>> git config --global user.name Elegant Git" ]]
29
+ [[
${lines[@]} =~ " What is your user email? {[email protected] }: " ]]
30
+ [[
${lines[@]} =~ " ==>> git config --global user.email [email protected] " ]]
31
+ [[ ${lines[@]} =~ " Please specify a command to start the editor. {vi}: " ]]
32
+ [[ ${lines[@]} =~ " ==>> git config --global core.editor vi" ]]
33
33
}
34
34
35
35
@test " 'acquire-git': standards are configured as expected on Windows" {
36
36
fake-pass " uname -s" Windows
37
37
check git-elegant acquire-git
38
- [[ " ${lines[@]} " =~ " ==>> git config --global core.commentChar |" ]]
39
- [[ " ${lines[@]} " =~ " ==>> git config --global apply.whitespace fix" ]]
40
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.prune true" ]]
41
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.pruneTags false" ]]
42
- [[ " ${lines[@]} " =~ " ==>> git config --global core.autocrlf true" ]]
43
- [[ " ${lines[@]} " =~ " ==>> git config --global pull.rebase true" ]]
44
- [[ " ${lines[@]} " =~ " ==>> git config --global rebase.autoStash false" ]]
45
- [[ " ${lines[@]} " =~ " ==>> git config --global elegant.acquired true" ]]
38
+ [[ ${lines[@]} =~ " ==>> git config --global core.commentChar |" ]]
39
+ [[ ${lines[@]} =~ " ==>> git config --global apply.whitespace fix" ]]
40
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.prune true" ]]
41
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.pruneTags false" ]]
42
+ [[ ${lines[@]} =~ " ==>> git config --global core.autocrlf true" ]]
43
+ [[ ${lines[@]} =~ " ==>> git config --global pull.rebase true" ]]
44
+ [[ ${lines[@]} =~ " ==>> git config --global rebase.autoStash false" ]]
45
+ [[ ${lines[@]} =~ " ==>> git config --global elegant.acquired true" ]]
46
46
# negative checks are used instead of checking commands size
47
- [[ ! " ${lines[@]} " =~ " ==>> git config --global credential.helper osxkeychain" ]]
48
- [[ ! " ${lines[@]} " =~ " ==>> git config --global core.autocrlf input" ]]
47
+ [[ ! ${lines[@]} =~ " ==>> git config --global credential.helper osxkeychain" ]]
48
+ [[ ! ${lines[@]} =~ " ==>> git config --global core.autocrlf input" ]]
49
49
}
50
50
51
51
@test " 'acquire-git': standards are configured as expected on Linux" {
52
52
fake-pass " uname -s" Linux
53
53
check git-elegant acquire-git
54
- [[ " ${lines[@]} " =~ " ==>> git config --global core.commentChar |" ]]
55
- [[ " ${lines[@]} " =~ " ==>> git config --global apply.whitespace fix" ]]
56
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.prune true" ]]
57
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.pruneTags false" ]]
58
- [[ " ${lines[@]} " =~ " ==>> git config --global core.autocrlf input" ]]
59
- [[ " ${lines[@]} " =~ " ==>> git config --global pull.rebase true" ]]
60
- [[ " ${lines[@]} " =~ " ==>> git config --global rebase.autoStash false" ]]
61
- [[ " ${lines[@]} " =~ " ==>> git config --global elegant.acquired true" ]]
54
+ [[ ${lines[@]} =~ " ==>> git config --global core.commentChar |" ]]
55
+ [[ ${lines[@]} =~ " ==>> git config --global apply.whitespace fix" ]]
56
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.prune true" ]]
57
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.pruneTags false" ]]
58
+ [[ ${lines[@]} =~ " ==>> git config --global core.autocrlf input" ]]
59
+ [[ ${lines[@]} =~ " ==>> git config --global pull.rebase true" ]]
60
+ [[ ${lines[@]} =~ " ==>> git config --global rebase.autoStash false" ]]
61
+ [[ ${lines[@]} =~ " ==>> git config --global elegant.acquired true" ]]
62
62
# negative checks are used instead of checking commands size
63
- [[ ! " ${lines[@]} " =~ " ==>> git config --global credential.helper osxkeychain" ]]
64
- [[ ! " ${lines[@]} " =~ " ==>> git config --global core.autocrlf true" ]]
63
+ [[ ! ${lines[@]} =~ " ==>> git config --global credential.helper osxkeychain" ]]
64
+ [[ ! ${lines[@]} =~ " ==>> git config --global core.autocrlf true" ]]
65
65
}
66
66
67
67
@test " 'acquire-git': standards are configured as expected on Darwin" {
68
68
fake-pass " uname -s" Darwin
69
69
check git-elegant acquire-git
70
- [[ " ${lines[@]} " =~ " ==>> git config --global core.commentChar |" ]]
71
- [[ " ${lines[@]} " =~ " ==>> git config --global apply.whitespace fix" ]]
72
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.prune true" ]]
73
- [[ " ${lines[@]} " =~ " ==>> git config --global fetch.pruneTags false" ]]
74
- [[ " ${lines[@]} " =~ " ==>> git config --global core.autocrlf input" ]]
75
- [[ " ${lines[@]} " =~ " ==>> git config --global pull.rebase true" ]]
76
- [[ " ${lines[@]} " =~ " ==>> git config --global rebase.autoStash false" ]]
77
- [[ " ${lines[@]} " =~ " ==>> git config --global credential.helper osxkeychain" ]]
78
- [[ " ${lines[@]} " =~ " ==>> git config --global elegant.acquired true" ]]
70
+ [[ ${lines[@]} =~ " ==>> git config --global core.commentChar |" ]]
71
+ [[ ${lines[@]} =~ " ==>> git config --global apply.whitespace fix" ]]
72
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.prune true" ]]
73
+ [[ ${lines[@]} =~ " ==>> git config --global fetch.pruneTags false" ]]
74
+ [[ ${lines[@]} =~ " ==>> git config --global core.autocrlf input" ]]
75
+ [[ ${lines[@]} =~ " ==>> git config --global pull.rebase true" ]]
76
+ [[ ${lines[@]} =~ " ==>> git config --global rebase.autoStash false" ]]
77
+ [[ ${lines[@]} =~ " ==>> git config --global credential.helper osxkeychain" ]]
78
+ [[ ${lines[@]} =~ " ==>> git config --global elegant.acquired true" ]]
79
79
# negative checks are used instead of checking commands size
80
- [[ ! " ${lines[@]} " =~ " ==>> git config --global core.autocrlf true" ]]
80
+ [[ ! ${lines[@]} =~ " ==>> git config --global core.autocrlf true" ]]
81
81
}
82
82
83
83
@test " 'acquire-git': new aliases are configured as expected" {
84
84
check git-elegant acquire-git
85
85
for next in $( git-elegant show-commands) ; do
86
86
echo " Test aliasing of '${next} ' command"
87
- [[ " ${lines[@]} " =~ " ==>> git config --global alias.${next} elegant ${next} " ]]
87
+ [[ ${lines[@]} =~ " ==>> git config --global alias.${next} elegant ${next} " ]]
88
88
echo " Tested successfully!"
89
89
done
90
90
}
@@ -93,26 +93,26 @@ teardown() {
93
93
repo git config --global " alias.aaa" " \" elegant aaa\" "
94
94
repo git config --global " alias.bbb" " \" elegant bbb\" "
95
95
check git-elegant acquire-git
96
- [[ " $ status" -eq 0 ]]
97
- [[ " ${lines[@]} " =~ " 2 Elegant Git aliases were removed." ]]
96
+ [[ ${ status} -eq 0 ]]
97
+ [[ ${lines[@]} =~ " 2 Elegant Git aliases were removed." ]]
98
98
}
99
99
100
100
@test " 'acquire-git': a message is displayed if global configuration is disabled" {
101
101
read-clean
102
102
read-answer " n"
103
103
check git-elegant acquire-git
104
- [[ " $ status" -eq 0 ]]
105
- [[ " ${lines[@]} " =~ " You've decided to stay with local configurations. Great!" ]]
104
+ [[ ${ status} -eq 0 ]]
105
+ [[ ${lines[@]} =~ " You've decided to stay with local configurations. Great!" ]]
106
106
}
107
107
108
108
@test " 'acquire-git': the basics are not changed if they are already configured" {
109
109
repo git config --global user.name aaaa
110
110
repo git config --global user.email aaaa
111
111
repo git config --global core.editor aaaa
112
112
check git-elegant acquire-git
113
- [[ " $ status" -eq 0 ]]
114
- [[ " ${lines[@]} " =~ " ==>> git config --global user.name aaaa" ]]
115
- [[ " ${lines[@]} " =~ " ==>> git config --global user.email aaaa" ]]
116
- [[ " ${lines[@]} " =~ " ==>> git config --global core.editor aaaa" ]]
117
- [[ ! " ${lines[@]} " =~ " Please hit enter if you wish {default value}." ]]
113
+ [[ ${ status} -eq 0 ]]
114
+ [[ ${lines[@]} =~ " ==>> git config --global user.name aaaa" ]]
115
+ [[ ${lines[@]} =~ " ==>> git config --global user.email aaaa" ]]
116
+ [[ ${lines[@]} =~ " ==>> git config --global core.editor aaaa" ]]
117
+ [[ ! ${lines[@]} =~ " Please hit enter if you wish {default value}." ]]
118
118
}
0 commit comments