test/completion: `shellcheck`

pull/2033/head
John D Pell 2022-02-13 16:29:39 -08:00 committed by John D Pell
parent 99decb8010
commit 5f11a0d3a2
2 changed files with 83 additions and 79 deletions

View File

@ -26,5 +26,5 @@ function local_setup_file() {
alias rm='rm -v' alias rm='rm -v'
run load "${BASH_IT?}/completion/available/aliases.completion.bash" run load "${BASH_IT?}/completion/available/aliases.completion.bash"
refute_output assert_output ""
} }

View File

@ -13,11 +13,12 @@ function local_setup_file() {
assert_output "function" assert_output "function"
} }
function __check_completion () { function __check_completion() {
# Get the parameters as a single value # Get the parameters as a single value
COMP_LINE=$* COMP_LINE=$*
# Get the parameters as an array # Get the parameters as an array
# shellcheck disable=SC2294
eval set -- "$@" eval set -- "$@"
COMP_WORDS=("$@") COMP_WORDS=("$@")
@ -25,7 +26,7 @@ function __check_completion () {
COMP_POINT=${#COMP_LINE} COMP_POINT=${#COMP_LINE}
# Get the last character of the line that was entered # Get the last character of the line that was entered
COMP_LAST=$((${COMP_POINT} - 1)) COMP_LAST=$((COMP_POINT - 1))
# If the last character was a space... # If the last character was a space...
if [[ ${COMP_LINE:$COMP_LAST} = ' ' ]]; then if [[ ${COMP_LINE:$COMP_LAST} = ' ' ]]; then
@ -45,315 +46,318 @@ function __check_completion () {
@test "completion bash-it: doctor - show options" { @test "completion bash-it: doctor - show options" {
run __check_completion 'bash-it doctor ' run __check_completion 'bash-it doctor '
assert_line -n 0 "errors warnings all" assert_output "errors warnings all"
} }
@test "completion bash-it: help - show options" { @test "completion bash-it: help - show options" {
run __check_completion 'bash-it help ' run __check_completion 'bash-it help '
assert_line -n 0 "aliases completions migrate plugins update" assert_output "aliases completions migrate plugins update"
} }
@test "completion bash-it: help - aliases v" { @test "completion bash-it: help - aliases v" {
run __check_completion 'bash-it help aliases v' run __check_completion 'bash-it help aliases v'
assert_line -n 0 "vagrant vault vim" assert_output "vagrant vault vim"
} }
@test "completion bash-it: update - show options" { @test "completion bash-it: update - show options" {
run __check_completion 'bash-it update ' run __check_completion 'bash-it update '
assert_line -n 0 "stable dev" assert_output "stable dev"
} }
@test "completion bash-it: update - show optional flags" { @test "completion bash-it: update - show optional flags" {
run __check_completion 'bash-it update -' run __check_completion 'bash-it update -'
assert_line -n 0 "-s --silent" assert_output "-s --silent"
} }
@test "completion bash-it: search - show no options" { @test "completion bash-it: search - show no options" {
run __check_completion 'bash-it search ' run __check_completion 'bash-it search '
assert_line -n 0 "" assert_output ""
} }
@test "completion bash-it: migrate - show no options" { @test "completion bash-it: migrate - show no options" {
run __check_completion 'bash-it migrate ' run __check_completion 'bash-it migrate '
assert_line -n 0 "" assert_output ""
} }
@test "completion bash-it: show options" { @test "completion bash-it: show options" {
run __check_completion 'bash-it ' run __check_completion 'bash-it '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: bash-ti - show options" { @test "completion bash-it: bash-ti - show options" {
run __check_completion 'bash-ti ' run __check_completion 'bash-ti '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: shit - show options" { @test "completion bash-it: shit - show options" {
run __check_completion 'shit ' run __check_completion 'shit '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: bashit - show options" { @test "completion bash-it: bashit - show options" {
run __check_completion 'bashit ' run __check_completion 'bashit '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: batshit - show options" { @test "completion bash-it: batshit - show options" {
run __check_completion 'batshit ' run __check_completion 'batshit '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: bash_it - show options" { @test "completion bash-it: bash_it - show options" {
run __check_completion 'bash_it ' run __check_completion 'bash_it '
assert_line -n 0 "disable enable help migrate reload restart preview profile doctor search show update version" assert_output "disable enable help migrate reload restart preview profile doctor search show update version"
} }
@test "completion bash-it: profile - show options" { @test "completion bash-it: profile - show options" {
run __check_completion 'bash-it profile ' run __check_completion 'bash-it profile '
assert_line -n 0 "load save list rm" assert_output "load save list rm"
} }
@test "completion bash-it: profile load - show options" { @test "completion bash-it: profile load - show options" {
run __check_completion 'bash-it profile load ' run __check_completion 'bash-it profile load '
assert_line -n 0 "default" assert_output "default"
} }
@test "completion bash-it: show - show options" { @test "completion bash-it: show - show options" {
run __check_completion 'bash-it show ' run __check_completion 'bash-it show '
assert_line -n 0 "aliases completions plugins" assert_output "aliases completions plugins"
} }
@test "completion bash-it: enable - show options" { @test "completion bash-it: enable - show options" {
run __check_completion 'bash-it enable ' run __check_completion 'bash-it enable '
assert_line -n 0 "alias completion plugin" assert_output "alias completion plugin"
} }
@test "completion bash-it: enable - show options a" { @test "completion bash-it: enable - show options a" {
run __check_completion 'bash-it enable a' run __check_completion 'bash-it enable a'
assert_line -n 0 "alias" assert_output "alias"
} }
@test "completion bash-it: disable - show options" { @test "completion bash-it: disable - show options" {
run __check_completion 'bash-it disable ' run __check_completion 'bash-it disable '
assert_line -n 0 "alias completion plugin" assert_output "alias completion plugin"
} }
@test "completion bash-it: disable - show options a" { @test "completion bash-it: disable - show options a" {
run __check_completion 'bash-it disable a' run __check_completion 'bash-it disable a'
assert_line -n 0 "alias" assert_output "alias"
} }
@test "completion bash-it: disable - provide nothing when atom is not enabled" { @test "completion bash-it: disable - provide nothing when atom is not enabled" {
run __check_completion 'bash-it disable alias ato' run __check_completion 'bash-it disable alias ato'
assert_line -n 0 "" assert_output ""
} }
@test "completion bash-it: disable - provide all when atom is not enabled" { @test "completion bash-it: disable - provide 'all' when atom is not enabled" {
run __check_completion 'bash-it disable alias a' run __check_completion 'bash-it disable alias a'
assert_line -n 0 "all" assert_output "all"
} }
@test "completion bash-it: disable - provide the a* aliases when atom is enabled with the old location and name" { @test "completion bash-it: disable - provide the a* aliases when atom is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/atom.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/atom.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/atom.aliases.bash"
ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/completion/enabled/apm.completion.bash" run ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/completion/enabled/apm.completion.bash"
assert_link_exist "$BASH_IT/completion/enabled/apm.completion.bash" assert_link_exist "$BASH_IT/completion/enabled/apm.completion.bash"
run _bash-it-component-item-is-enabled "alias" "atom"
assert_success
run __check_completion 'bash-it disable alias a' run __check_completion 'bash-it disable alias a'
assert_line -n 0 "all atom" assert_output "all atom"
} }
@test "completion bash-it: disable - provide the a* aliases when atom is enabled with the old location and priority-based name" { @test "completion bash-it: disable - provide the a* aliases when atom is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/150---atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/150---atom.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---atom.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---atom.aliases.bash"
ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/completion/enabled/350---apm.completion.bash" run ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/completion/enabled/350---apm.completion.bash"
assert_link_exist "$BASH_IT/completion/enabled/350---apm.completion.bash" assert_link_exist "$BASH_IT/completion/enabled/350---apm.completion.bash"
run __check_completion 'bash-it disable alias a' run __check_completion 'bash-it disable alias a'
assert_line -n 0 "all atom" assert_output "all atom"
} }
@test "completion bash-it: disable - provide the a* aliases when atom is enabled with the new location and priority-based name" { @test "completion bash-it: disable - provide the a* aliases when atom is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/enabled/150---atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/enabled/150---atom.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---atom.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---atom.aliases.bash"
ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/enabled/350---apm.completion.bash" run ln -s "$BASH_IT/completion/available/apm.completion.bash" "$BASH_IT/enabled/350---apm.completion.bash"
assert_link_exist "$BASH_IT/enabled/350---apm.completion.bash" assert_link_exist "$BASH_IT/enabled/350---apm.completion.bash"
run __check_completion 'bash-it disable alias a' run __check_completion 'bash-it disable alias a'
assert_line -n 0 "all atom" assert_output "all atom"
} }
@test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the old location and name" { @test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/plugins/enabled/docker-machine.plugin.bash" run ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/plugins/enabled/docker-machine.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/docker-machine.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/docker-machine.plugin.bash"
run __check_completion 'bash-it disable plugin docker' run __check_completion 'bash-it disable plugin docker'
assert_line -n 0 "docker-machine" assert_output "docker-machine"
} }
@test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the old location and priority-based name" { @test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/plugins/enabled/350---docker-machine.plugin.bash" run ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/plugins/enabled/350---docker-machine.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/350---docker-machine.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/350---docker-machine.plugin.bash"
run __check_completion 'bash-it disable plugin docker' run __check_completion 'bash-it disable plugin docker'
assert_line -n 0 "docker-machine" assert_output "docker-machine"
} }
@test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the new location and priority-based name" { @test "completion bash-it: disable - provide the docker-machine plugin when docker-machine is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash"
ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/enabled/350---docker-machine.plugin.bash" run ln -s "$BASH_IT/plugins/available/docker-machine.plugin.bash" "$BASH_IT/enabled/350---docker-machine.plugin.bash"
assert_link_exist "$BASH_IT/enabled/350---docker-machine.plugin.bash" assert_link_exist "$BASH_IT/enabled/350---docker-machine.plugin.bash"
run __check_completion 'bash-it disable plugin docker' run __check_completion 'bash-it disable plugin docker'
assert_line -n 0 "docker-machine" assert_output "docker-machine"
} }
@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and name" { @test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/aliases/enabled/todo.txt-cli.aliases.bash" run ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/aliases/enabled/todo.txt-cli.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/todo.txt-cli.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/todo.txt-cli.aliases.bash"
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/todo.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/todo.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/todo.plugin.bash"
run __check_completion 'bash-it disable alias to' run __check_completion 'bash-it disable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }
@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" { @test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/aliases/enabled/150---todo.txt-cli.aliases.bash" run ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/aliases/enabled/150---todo.txt-cli.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---todo.txt-cli.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---todo.txt-cli.aliases.bash"
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/350---todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/350---todo.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/350---todo.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/350---todo.plugin.bash"
run __check_completion 'bash-it disable alias to' run __check_completion 'bash-it disable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }
@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" { @test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/enabled/150---todo.txt-cli.aliases.bash" run ln -s "$BASH_IT/aliases/available/todo.txt-cli.aliases.bash" "$BASH_IT/enabled/150---todo.txt-cli.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---todo.txt-cli.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---todo.txt-cli.aliases.bash"
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/enabled/350---todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/enabled/350---todo.plugin.bash"
assert_link_exist "$BASH_IT/enabled/350---todo.plugin.bash" assert_link_exist "$BASH_IT/enabled/350---todo.plugin.bash"
run __check_completion 'bash-it disable alias to' run __check_completion 'bash-it disable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }
@test "completion bash-it: enable - provide the atom aliases when not enabled" { @test "completion bash-it: enable - provide the atom aliases when not enabled" {
run __check_completion 'bash-it enable alias ato' run __check_completion 'bash-it enable alias ato'
assert_line -n 0 "atom" assert_output "atom"
} }
@test "completion bash-it: enable - provide the a* aliases when not enabled" { @test "completion bash-it: enable - provide the a* aliases when not enabled" {
run __check_completion 'bash-it enable alias a' run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt atom" assert_output "all ag ansible apt atom"
} }
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and name" { @test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/atom.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/atom.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/atom.aliases.bash"
run __check_completion 'bash-it enable alias a' run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt" assert_output "all ag ansible apt"
} }
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and priority-based name" { @test "completion bash-it: enable - provide the a* aliases when atom is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/150---atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/aliases/enabled/150---atom.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---atom.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---atom.aliases.bash"
run __check_completion 'bash-it enable alias a' run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt" assert_output "all ag ansible apt"
} }
@test "completion bash-it: enable - provide the a* aliases when atom is enabled with the new location and priority-based name" { @test "completion bash-it: enable - provide the a* aliases when atom is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/enabled/150---atom.aliases.bash" run ln -s "$BASH_IT/aliases/available/atom.aliases.bash" "$BASH_IT/enabled/150---atom.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---atom.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---atom.aliases.bash"
run __check_completion 'bash-it enable alias a' run __check_completion 'bash-it enable alias a'
assert_line -n 0 "all ag ansible apt" assert_output "all ag ansible apt"
} }
@test "completion bash-it: enable - provide the docker* plugins when docker-compose is enabled with the old location and name" { @test "completion bash-it: enable - provide the docker* plugins when docker-compose is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
run __check_completion 'bash-it enable plugin docker' run __check_completion 'bash-it enable plugin docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the docker-* plugins when docker-compose is enabled with the old location and priority-based name" { @test "completion bash-it: enable - provide the docker-* plugins when docker-compose is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
run __check_completion 'bash-it enable plugin docker' run __check_completion 'bash-it enable plugin docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the docker-* plugins when docker-compose is enabled with the new location and priority-based name" { @test "completion bash-it: enable - provide the docker-* plugins when docker-compose is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash"
run __check_completion 'bash-it enable plugin docker' run __check_completion 'bash-it enable plugin docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the old location and name" { @test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the old location and name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/docker-compose.aliases.bash"
run __check_completion 'bash-it enable completion docker' run __check_completion 'bash-it enable completion docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the old location and priority-based name" { @test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/aliases/enabled/150---docker-compose.aliases.bash"
run __check_completion 'bash-it enable completion docker' run __check_completion 'bash-it enable completion docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the new location and priority-based name" { @test "completion bash-it: enable - provide the docker* completions when docker-compose is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash" run ln -s "$BASH_IT/aliases/available/docker-compose.aliases.bash" "$BASH_IT/enabled/150---docker-compose.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash" assert_link_exist "$BASH_IT/enabled/150---docker-compose.aliases.bash"
run __check_completion 'bash-it enable completion docker' run __check_completion 'bash-it enable completion docker'
assert_line -n 0 "docker docker-compose docker-machine" assert_output "docker docker-compose docker-machine"
} }
@test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and name" { @test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and name" {
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/todo.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/todo.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/todo.plugin.bash"
run __check_completion 'bash-it enable alias to' run __check_completion 'bash-it enable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }
@test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" { @test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" {
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/350---todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/plugins/enabled/350---todo.plugin.bash"
assert_link_exist "$BASH_IT/plugins/enabled/350---todo.plugin.bash" assert_link_exist "$BASH_IT/plugins/enabled/350---todo.plugin.bash"
run __check_completion 'bash-it enable alias to' run __check_completion 'bash-it enable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }
@test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" { @test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" {
ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/enabled/350---todo.plugin.bash" run ln -s "$BASH_IT/plugins/available/todo.plugin.bash" "$BASH_IT/enabled/350---todo.plugin.bash"
assert_link_exist "$BASH_IT/enabled/350---todo.plugin.bash" assert_link_exist "$BASH_IT/enabled/350---todo.plugin.bash"
run __check_completion 'bash-it enable alias to' run __check_completion 'bash-it enable alias to'
assert_line -n 0 "todo.txt-cli" assert_output "todo.txt-cli"
} }