Skip to content

rename todo aliases file to avoid activation failure #2321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions test/completion/bash-it.completion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -224,36 +224,36 @@ function __check_completion() {
}

@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and name" {
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"
run ln -s "$BASH_IT/aliases/available/todo.aliases.bash" "$BASH_IT/aliases/enabled/todo.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/todo.aliases.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"

run __check_completion 'bash-it disable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}

@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" {
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"
run ln -s "$BASH_IT/aliases/available/todo.aliases.bash" "$BASH_IT/aliases/enabled/150---todo.aliases.bash"
assert_link_exist "$BASH_IT/aliases/enabled/150---todo.aliases.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"

run __check_completion 'bash-it disable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}

@test "completion bash-it: disable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" {
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"
run ln -s "$BASH_IT/aliases/available/todo.aliases.bash" "$BASH_IT/enabled/150---todo.aliases.bash"
assert_link_exist "$BASH_IT/enabled/150---todo.aliases.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"

run __check_completion 'bash-it disable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}

@test "completion bash-it: enable - provide the atom aliases when not enabled" {
Expand Down Expand Up @@ -343,21 +343,21 @@ function __check_completion() {
assert_link_exist "$BASH_IT/plugins/enabled/todo.plugin.bash"

run __check_completion 'bash-it enable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}

@test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the old location and priority-based name" {
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"

run __check_completion 'bash-it enable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}

@test "completion bash-it: enable - provide the todo.txt-cli aliases when todo plugin is enabled with the new location and priority-based name" {
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"

run __check_completion 'bash-it enable alias to'
assert_output "todo.txt-cli"
assert_output "todo"
}
18 changes: 9 additions & 9 deletions test/lib/helpers.bats
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ function local_setup() {

@test "helpers: enable the todo.txt-cli aliases through the bash-it function" {
run bash-it enable alias "todo.txt-cli"
assert_line -n 0 'todo.txt-cli enabled with priority 150.'
assert_link_exist "${BASH_IT?}/enabled/150---todo.txt-cli.aliases.bash"
assert_line -n 0 'todo enabled with priority 150.'
assert_link_exist "${BASH_IT?}/enabled/150---todo.aliases.bash"
}

@test "helpers: enable the curl aliases" {
Expand Down Expand Up @@ -439,14 +439,14 @@ function local_setup() {
assert_link_exist "${BASH_IT?}/enabled/250---ssh.plugin.bash"

run _bash-it-migrate
assert_line -n 0 'Migrating alias todo.txt-cli.'
assert_line -n 1 'todo.txt-cli disabled.'
assert_line -n 2 'todo.txt-cli enabled with priority 150.'
assert_line -n 0 'Migrating alias todo.'
assert_line -n 1 'todo disabled.'
assert_line -n 2 'todo enabled with priority 150.'

assert_link_exist "${BASH_IT?}/enabled/225---nvm.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/250---node.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/250---ssh.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/150---todo.txt-cli.aliases.bash"
assert_link_exist "${BASH_IT?}/enabled/150---todo.aliases.bash"
assert [ ! -L "${BASH_IT?}/plugins/enabled/node.plugin.bash" ]
assert [ ! -L "${BASH_IT?}/plugins/enabled/nvm.plugin.bash" ]
assert [ ! -L "${BASH_IT?}/aliases/enabled/todo.txt-cli.aliases.bash" ]
Expand All @@ -469,10 +469,10 @@ function local_setup() {
assert_link_exist "${BASH_IT?}/enabled/225---nvm.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/250---node.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/250---ssh.plugin.bash"
assert_link_exist "${BASH_IT?}/enabled/150---todo.txt-cli.aliases.bash"
assert_link_exist "${BASH_IT?}/enabled/150---todo.aliases.bash"
assert [ ! -L "${BASH_IT?}/plugins/enabled/225----node.plugin.bash" ]
assert [ ! -L "${BASH_IT?}/plugins/enabled/250----nvm.plugin.bash" ]
assert [ ! -L "${BASH_IT?}/aliases/enabled/250----todo.txt-cli.aliases.bash" ]
assert [ ! -L "${BASH_IT?}/aliases/enabled/250----todo.aliases.bash" ]
}

@test "helpers: run the migrate command without anything to migrate and nothing enabled" {
Expand Down Expand Up @@ -713,5 +713,5 @@ function __migrate_all_components() {

@test "helpers: describe the todo.txt-cli aliases without enabling them" {
run _bash-it-aliases
assert_line "todo.txt-cli [ ] todo.txt-cli abbreviations"
assert_line "todo [ ] todo.txt-cli abbreviations"
}
Loading