Skip to content

Commit

Permalink
Use _require_argument() name consistently and update tests.
Browse files Browse the repository at this point in the history
These changes are an extension of afd50eb, which was incomplete.
  • Loading branch information
xwmx committed Jan 26, 2016
1 parent afd50eb commit 349962b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bash-simple-plus
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,12 @@ do
_OPTION_X=1
;;
-o)
_require_parameter "$_option" "$_maybe_param"
_require_argument "$_option" "$_maybe_param"
_SHORT_OPTION_WITH_PARAMETER="${_maybe_param}"
shift
;;
--long-option-with-argument)
_require_parameter "$_option" "$_maybe_param"
_require_argument "$_option" "$_maybe_param"
_LONG_OPTION_WITH_PARAMETER="${_maybe_param}"
shift
;;
Expand Down
4 changes: 2 additions & 2 deletions test/bash-simple-plus.bats
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ setup() {

@test "\`bash-simple-plus -o\` with no value prints message." {
run "$_COMMAND" -o
[[ "$output" =~ Option\ requires\ a\ parameter ]]
[[ "$output" == "Option requires a argument: -o" ]]
}

@test "\`bash-simple-plus -o\` with value exits with status 0." {
Expand All @@ -95,7 +95,7 @@ setup() {

@test "\`bash-simple-plus\` with long option and missing required value prints message." {
run "$_COMMAND" --long-option-with-argument
[[ "$output" =~ Option\ requires\ a\ parameter ]]
[[ "$output" =~ "Option requires a argument: --long-option-with-argument" ]]
}

@test "\`bash-simple-plus\` with option and required value exits with status 0." {
Expand Down

0 comments on commit 349962b

Please sign in to comment.