From b0862899d7cbd8cbfcc9465e09f1aa9b004470e0 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 16 Jan 2022 10:23:02 -0800 Subject: [PATCH] completion/alias: fix tests --- test/completion/aliases.completion.bats | 7 ++++--- test/fixtures/bash_it/profiles/test-bad-component.bash_it | 2 +- test/fixtures/bash_it/profiles/test-bad-type.bash_it | 4 ++-- test/install/install.bats | 2 +- test/lib/helpers.bats | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/test/completion/aliases.completion.bats b/test/completion/aliases.completion.bats index 20d13cf2..813a7bbd 100644 --- a/test/completion/aliases.completion.bats +++ b/test/completion/aliases.completion.bats @@ -3,25 +3,26 @@ load ../test_helper load ../test_helper_libs +# Load something, anything... load ../../completion/available/capistrano.completion @test "alias-completion: See that aliases with double quotes and brackets do not break the plugin" { alias gtest="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative" - load ../../plugins/available/alias-completion.plugin + run load ../../completion/available/aliases.completion assert_success } @test "alias-completion: See that aliases with single quotes and brackets do not break the plugin" { alias gtest='git log --graph --pretty=format:"%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset" --abbrev-commit --date=relative' - load ../../plugins/available/alias-completion.plugin + run load ../../completion/available/aliases.completion assert_success } @test "alias-completion: See that having aliased rm command does not output unnecessary output" { alias rm='rm -v' - load ../../plugins/available/alias-completion.plugin + run load ../../completion/available/aliases.completion refute_output } diff --git a/test/fixtures/bash_it/profiles/test-bad-component.bash_it b/test/fixtures/bash_it/profiles/test-bad-component.bash_it index 8640265c..068c4b63 100644 --- a/test/fixtures/bash_it/profiles/test-bad-component.bash_it +++ b/test/fixtures/bash_it/profiles/test-bad-component.bash_it @@ -1,8 +1,8 @@ # plugins -plugins alias-completion plugins base # completion +completion aliases completion bash-it completion system diff --git a/test/fixtures/bash_it/profiles/test-bad-type.bash_it b/test/fixtures/bash_it/profiles/test-bad-type.bash_it index ed2d2373..102c52ea 100644 --- a/test/fixtures/bash_it/profiles/test-bad-type.bash_it +++ b/test/fixtures/bash_it/profiles/test-bad-type.bash_it @@ -1,10 +1,10 @@ # plugins -plugins alias-completion plugins base # Bad type -pluugins alias-completion +compleetion aliases # completion +completion aliases completion bash-it completion system diff --git a/test/install/install.bats b/test/install/install.bats index 262bf4f0..b3aee5a7 100644 --- a/test/install/install.bats +++ b/test/install/install.bats @@ -29,7 +29,7 @@ function local_setup { assert_link_exist "$BASH_IT/enabled/150---general.aliases.bash" assert_link_exist "$BASH_IT/enabled/250---base.plugin.bash" - assert_link_exist "$BASH_IT/enabled/365---alias-completion.plugin.bash" + assert_link_exist "$BASH_IT/enabled/800---aliases.completion.bash" assert_link_exist "$BASH_IT/enabled/350---bash-it.completion.bash" assert_link_exist "$BASH_IT/enabled/325---system.completion.bash" } diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index bd339d04..8c340c58 100755 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -296,7 +296,7 @@ function local_setup { assert_link_exist "$BASH_IT/enabled/150---general.aliases.bash" assert_link_exist "$BASH_IT/enabled/250---base.plugin.bash" - assert_link_exist "$BASH_IT/enabled/365---alias-completion.plugin.bash" + assert_link_exist "$BASH_IT/enabled/800---aliases.completion.bash" assert_link_exist "$BASH_IT/enabled/350---bash-it.completion.bash" assert_link_exist "$BASH_IT/enabled/325---system.completion.bash" } @@ -356,7 +356,7 @@ function local_setup { run _bash-it-profile-load "test" assert_link_not_exist "$BASH_IT/enabled/150---general.aliases.bash" assert_link_not_exist "$BASH_IT/enabled/250---base.plugin.bash" - assert_link_not_exist "$BASH_IT/enabled/365---alias-completion.plugin.bash" + assert_link_not_exist "$BASH_IT/enabled/800---aliases.completion.bash" assert_link_not_exist "$BASH_IT/enabled/350---bash-it.completion.bash" assert_link_not_exist "$BASH_IT/enabled/325---system.completion.bash" } @@ -384,7 +384,7 @@ function local_setup { @test "helpers: profile load corrupted profile file: bad subdirectory" { run _bash-it-profile-load "test-bad-type" - assert_line -n 1 -p "Bad line(#5) in profile, aborting load..." + assert_line -n 1 -p "Bad line(#4) in profile, aborting load..." } @test "helpers: profile rm sanity" {