You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/utility/parse-args_spec.sh
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ Describe 'parse-arg.sh'
75
75
The output should equal "Version: v0.1.0"
76
76
End
77
77
End
78
-
Describe 'errors'
78
+
Describe 'errors:'
79
79
It 'not enough arguments passed'
80
80
declare version
81
81
declare params=(version -v '')
@@ -115,7 +115,17 @@ Describe 'parse-arg.sh'
115
115
The stderr should include "$(printf "array \033[0;36massociativeParams\033[0m is broken")"
116
116
The stderr should include 'The first argument to parse_args_exitIfParameterDefinitionIsNotTriple needs to be a non-associative array containing parameter definitions'
117
117
End
118
-
It 'fails if variable not defined in scope'
118
+
It 'first variable not defined in scope'
119
+
declare version
120
+
declare params=(
121
+
asdf -a ''
122
+
version -v ''
123
+
)
124
+
When run parseArguments params 'example''v1.0.0' -v v0.1.0
125
+
The status should be failure
126
+
The stderr should include "$(printf "you need to \`declare\` (\`local\`) the variable \033[0;36masdf\033[0m")"
logError "you need to \`declare\` (\`local\`) the variable \033[0;36m%s\033[0m otherwise we write to the global scope (you can also \`declare\` it in the global scope)""$variableName"
0 commit comments