Change test prefixes to match file name

pull/1043/head
Nils Winkler 2017-09-15 08:10:15 +02:00
parent e53b5dc96e
commit d798bb8f06
2 changed files with 43 additions and 43 deletions

View File

@ -30,31 +30,31 @@ function local_setup {
# TODO Create global __get_base_name function
# TODO Create global __get_enabled_name function
@test "bash-it: enable the todo.txt-cli aliases through the bash-it function" {
@test "helpers: enable the todo.txt-cli aliases through the bash-it function" {
run bash-it enable alias "todo.txt-cli"
assert_line "0" 'todo.txt-cli enabled with priority 150.'
assert [ -L "$BASH_IT/enabled/150---todo.txt-cli.aliases.bash" ]
}
@test "bash-it: enable the curl aliases" {
@test "helpers: enable the curl aliases" {
run _enable-alias "curl"
assert_line "0" 'curl enabled with priority 150.'
assert [ -L "$BASH_IT/enabled/150---curl.aliases.bash" ]
}
@test "bash-it: enable the apm completion through the bash-it function" {
@test "helpers: enable the apm completion through the bash-it function" {
run bash-it enable completion "apm"
assert_line "0" 'apm enabled with priority 350.'
assert [ -L "$BASH_IT/enabled/350---apm.completion.bash" ]
}
@test "bash-it: enable the brew completion" {
@test "helpers: enable the brew completion" {
run _enable-completion "brew"
assert_line "0" 'brew enabled with priority 350.'
assert [ -L "$BASH_IT/enabled/350---brew.completion.bash" ]
}
@test "bash-it: enable the node plugin" {
@test "helpers: enable the node plugin" {
run _enable-plugin "node"
assert_line "0" 'node enabled with priority 250.'
assert [ -L "$BASH_IT/enabled/250---node.plugin.bash" ]
@ -62,13 +62,13 @@ function local_setup {
assert_equal "../plugins/available/node.plugin.bash" "`readlink $BASH_IT/enabled/250---node.plugin.bash`"
}
@test "bash-it: enable the node plugin through the bash-it function" {
@test "helpers: enable the node plugin through the bash-it function" {
run bash-it enable plugin "node"
assert_line "0" 'node enabled with priority 250.'
assert [ -L "$BASH_IT/enabled/250---node.plugin.bash" ]
}
@test "bash-it: enable the node and nvm plugins through the bash-it function" {
@test "helpers: enable the node and nvm plugins through the bash-it function" {
run bash-it enable plugin "node" "nvm"
assert_line "0" 'node enabled with priority 250.'
assert_line "1" 'nvm enabled with priority 225.'
@ -76,20 +76,20 @@ function local_setup {
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: enable the foo-unkown and nvm plugins through the bash-it function" {
@test "helpers: enable the foo-unkown and nvm plugins through the bash-it function" {
run bash-it enable plugin "foo-unknown" "nvm"
assert_line "0" 'sorry, foo-unknown does not appear to be an available plugin.'
assert_line "1" 'nvm enabled with priority 225.'
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: enable the nvm plugin" {
@test "helpers: enable the nvm plugin" {
run _enable-plugin "nvm"
assert_line "0" 'nvm enabled with priority 225.'
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: enable an unknown plugin" {
@test "helpers: enable an unknown plugin" {
run _enable-plugin "unknown-foo"
assert_line "0" 'sorry, unknown-foo does not appear to be an available plugin.'
@ -101,7 +101,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/unknown-foo.plugin.bash" ]
}
@test "bash-it: enable an unknown plugin through the bash-it function" {
@test "helpers: enable an unknown plugin through the bash-it function" {
run bash-it enable plugin "unknown-foo"
echo "${lines[@]}"
assert_line "0" 'sorry, unknown-foo does not appear to be an available plugin.'
@ -114,12 +114,12 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/unknown-foo.plugin.bash" ]
}
@test "bash-it: disable a plugin that is not enabled" {
@test "helpers: disable a plugin that is not enabled" {
run _disable-plugin "sdkman"
assert_line "0" 'sorry, sdkman does not appear to be an enabled plugin.'
}
@test "bash-it: enable and disable the nvm plugin" {
@test "helpers: enable and disable the nvm plugin" {
run _enable-plugin "nvm"
assert_line "0" 'nvm enabled with priority 225.'
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
@ -130,7 +130,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: disable the nvm plugin if it was enabled with a priority, but in the component-specific directory" {
@test "helpers: disable the nvm plugin if it was enabled with a priority, but in the component-specific directory" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/225---nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/225---nvm.plugin.bash" ]
assert [ ! -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
@ -141,7 +141,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: disable the nvm plugin if it was enabled without a priority" {
@test "helpers: disable the nvm plugin if it was enabled without a priority" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
@ -150,7 +150,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
}
@test "bash-it: enable the nvm plugin if it was enabled without a priority" {
@test "helpers: enable the nvm plugin if it was enabled without a priority" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
@ -161,7 +161,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: enable the nvm plugin if it was enabled with a priority, but in the component-specific directory" {
@test "helpers: enable the nvm plugin if it was enabled with a priority, but in the component-specific directory" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/225---nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/225---nvm.plugin.bash" ]
@ -172,7 +172,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: enable the nvm plugin twice" {
@test "helpers: enable the nvm plugin twice" {
run _enable-plugin "nvm"
assert_line "0" 'nvm enabled with priority 225.'
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
@ -182,7 +182,7 @@ function local_setup {
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
}
@test "bash-it: migrate enabled plugins that don't use the new priority-based configuration" {
@test "helpers: migrate enabled plugins that don't use the new priority-based configuration" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
@ -206,7 +206,7 @@ function local_setup {
assert [ ! -L "$BASH_IT/aliases/enabled/todo.txt-cli.aliases.bash" ]
}
@test "bash-it: migrate enabled plugins that use the new priority-based configuration in the individual directories" {
@test "helpers: migrate enabled plugins that use the new priority-based configuration in the individual directories" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/225---nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/225---nvm.plugin.bash" ]
@ -229,11 +229,11 @@ function local_setup {
assert [ ! -L "$BASH_IT/aliases/enabled/250----todo.txt-cli.aliases.bash" ]
}
@test "bash-it: run the migrate command without anything to migrate and nothing enabled" {
@test "helpers: run the migrate command without anything to migrate and nothing enabled" {
run _bash-it-migrate
}
@test "bash-it: run the migrate command without anything to migrate" {
@test "helpers: run the migrate command without anything to migrate" {
run _enable-plugin "ssh"
assert [ -L "$BASH_IT/enabled/250---ssh.plugin.bash" ]
@ -272,49 +272,49 @@ function __migrate_all_components() {
assert_equal "$all_enabled_old" "$all_enabled_new_after"
}
@test "bash-it: migrate all plugins" {
@test "helpers: migrate all plugins" {
subdirectory="plugins"
one_type="plugin"
__migrate_all_components "$subdirectory" "$one_type"
}
@test "bash-it: migrate all aliases" {
@test "helpers: migrate all aliases" {
subdirectory="aliases"
one_type="aliases"
__migrate_all_components "$subdirectory" "$one_type"
}
@test "bash-it: migrate all completions" {
@test "helpers: migrate all completions" {
subdirectory="completion"
one_type="completion"
__migrate_all_components "$subdirectory" "$one_type"
}
@test "bash-it: migrate all plugins with previous priority" {
@test "helpers: migrate all plugins with previous priority" {
subdirectory="plugins"
one_type="plugin"
__migrate_all_components "$subdirectory" "$one_type" "100"
}
@test "bash-it: migrate all aliases with previous priority" {
@test "helpers: migrate all aliases with previous priority" {
subdirectory="aliases"
one_type="aliases"
__migrate_all_components "$subdirectory" "$one_type" "100"
}
@test "bash-it: migrate all completions with previous priority" {
@test "helpers: migrate all completions with previous priority" {
subdirectory="completion"
one_type="completion"
__migrate_all_components "$subdirectory" "$one_type" "100"
}
@test "bash-it: verify that existing components are automatically migrated when something is enabled" {
@test "helpers: verify that existing components are automatically migrated when something is enabled" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
@ -328,7 +328,7 @@ function __migrate_all_components() {
assert [ -L "$BASH_IT/enabled/250---node.plugin.bash" ]
}
@test "bash-it: verify that existing components are automatically migrated when something is disabled" {
@test "helpers: verify that existing components are automatically migrated when something is disabled" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
ln -s $BASH_IT/plugins/available/node.plugin.bash $BASH_IT/plugins/enabled/250---node.plugin.bash
@ -348,14 +348,14 @@ function __migrate_all_components() {
assert [ ! -L "$BASH_IT/enabled/250---node.plugin.bash" ]
}
@test "bash-it: enable all plugins" {
@test "helpers: enable all plugins" {
run _enable-plugin "all"
local available=$(find $BASH_IT/plugins/available -name *.plugin.bash | wc -l | xargs)
local enabled=$(find $BASH_IT/enabled -name [0-9]*.plugin.bash | wc -l | xargs)
assert_equal "$available" "$enabled"
}
@test "bash-it: disable all plugins" {
@test "helpers: disable all plugins" {
run _enable-plugin "all"
local available=$(find $BASH_IT/plugins/available -name *.plugin.bash | wc -l | xargs)
local enabled=$(find $BASH_IT/enabled -name [0-9]*.plugin.bash | wc -l | xargs)
@ -370,17 +370,17 @@ function __migrate_all_components() {
assert [ -L "$BASH_IT/enabled/150---ag.aliases.bash" ]
}
@test "bash-it: enable the ansible aliases through the bash-it function" {
@test "helpers: enable the ansible aliases through the bash-it function" {
run bash-it enable alias "ansible"
assert_line "0" 'ansible enabled with priority 150.'
assert [ -L "$BASH_IT/enabled/150---ansible.aliases.bash" ]
}
@test "bash-it: describe the nvm plugin without enabling it" {
@test "helpers: describe the nvm plugin without enabling it" {
_bash-it-plugins | grep "nvm" | grep "\[ \]"
}
@test "bash-it: describe the nvm plugin after enabling it" {
@test "helpers: describe the nvm plugin after enabling it" {
run _enable-plugin "nvm"
assert_line "0" 'nvm enabled with priority 225.'
assert [ -L "$BASH_IT/enabled/225---nvm.plugin.bash" ]
@ -388,21 +388,21 @@ function __migrate_all_components() {
_bash-it-plugins | grep "nvm" | grep "\[x\]"
}
@test "bash-it: describe the nvm plugin after enabling it in the old directory" {
@test "helpers: describe the nvm plugin after enabling it in the old directory" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/nvm.plugin.bash" ]
_bash-it-plugins | grep "nvm" | grep "\[x\]"
}
@test "bash-it: describe the nvm plugin after enabling it in the old directory with priority" {
@test "helpers: describe the nvm plugin after enabling it in the old directory with priority" {
ln -s $BASH_IT/plugins/available/nvm.plugin.bash $BASH_IT/plugins/enabled/225---nvm.plugin.bash
assert [ -L "$BASH_IT/plugins/enabled/225---nvm.plugin.bash" ]
_bash-it-plugins | grep "nvm" | grep "\[x\]"
}
@test "bash-it: describe the todo.txt-cli aliases without enabling them" {
@test "helpers: describe the todo.txt-cli aliases without enabling them" {
run _bash-it-aliases
assert_line "todo.txt-cli [ ] todo.txt-cli abbreviations"
}

View File

@ -25,12 +25,12 @@ function local_setup {
rm -rf "$BASH_IT"/plugins/enabled
}
@test "helpers search plugins" {
@test "search: plugin base" {
run _bash-it-search-component 'plugins' 'base'
[[ "${lines[0]}" =~ 'plugins' && "${lines[0]}" =~ 'base' ]]
}
@test "helpers search ruby gem bundle rake rails" {
@test "search: ruby gem bundle rake rails" {
# first disable them all, so that the output does not appear with a checkbox
# and we can compare the result
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' 'rails' '--disable'
@ -42,7 +42,7 @@ function local_setup {
assert [ "${lines[2]/✓/}" == ' completions => bundler gem rake' ]
}
@test "search ruby gem bundle -chruby rake rails" {
@test "search: ruby gem bundle -chruby rake rails" {
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' 'rails' '--disable'
run _bash-it-search 'ruby' 'gem' 'bundle' '-chruby' 'rake' 'rails'
assert [ "${lines[0]/✓/}" == ' aliases => bundler rails' ]
@ -50,7 +50,7 @@ function local_setup {
assert [ "${lines[2]/✓/}" == ' completions => bundler gem rake' ]
}
@test "search (rails enabled) ruby gem bundle rake rails" {
@test "search: (rails enabled) ruby gem bundle rake rails" {
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' 'rails' '--disable'
run _enable-alias 'rails'
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' 'rails'
@ -59,7 +59,7 @@ function local_setup {
assert_line "2" ' completions => bundler gem rake'
}
@test "search (all enabled) ruby gem bundle rake rails" {
@test "search: (all enabled) ruby gem bundle rake rails" {
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' '-chruby' 'rails' '--enable'
run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' '-chruby' 'rails'
assert_line "0" ' aliases => ✓bundler ✓rails'