Skip to content

Commit

Permalink
tests: Fix tests after libs update
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahGorny committed Mar 3, 2022
1 parent 9fe568a commit fd93628
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 18 deletions.
8 changes: 4 additions & 4 deletions test/completion/bash-it.completion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function local_setup {
}

@test "completion bash-it: ensure that the _bash-it function is available" {
type -a _bash-it &> /dev/null
run type -a _bash-it &> /dev/null
assert_success
}

Expand Down Expand Up @@ -71,12 +71,12 @@ function __check_completion () {

@test "completion bash-it: search - show no options" {
run __check_completion 'bash-it search '
assert_line -n 0 ""
assert_output ""
}

@test "completion bash-it: migrate - show no options" {
run __check_completion 'bash-it migrate '
assert_line -n 0 ""
assert_output ""
}

@test "completion bash-it: show options" {
Expand Down Expand Up @@ -146,7 +146,7 @@ function __check_completion () {

@test "completion bash-it: disable - provide nothing when atom is not enabled" {
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" {
Expand Down
4 changes: 2 additions & 2 deletions test/install/uninstall.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function local_setup {
echo "test file content for original file" > "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
local md5_bak=$(md5sum "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE.bak" | awk '{print $1}')

./uninstall.sh
run ./uninstall.sh

assert_success

Expand All @@ -46,7 +46,7 @@ function local_setup {
echo "test file content for original file" > "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE"
local md5_orig=$(md5sum "$BASH_IT_TEST_HOME/$BASH_IT_CONFIG_FILE" | awk '{print $1}')

./uninstall.sh
run ./uninstall.sh

assert_success

Expand Down
2 changes: 1 addition & 1 deletion test/lib/helpers.bats
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function local_setup {

@test "helpers: bash-it help aliases without any aliases enabled" {
run bash-it help aliases
assert_line -n 0 ""
assert_output ""
}

@test "helpers: bash-it help plugins" {
Expand Down
8 changes: 0 additions & 8 deletions test/lib/preexec.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ function local_setup {
export PROMPT_COMMAND="$test_prompt_string"

load ../../vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh
assert_success

assert_equal "${PROMPT_COMMAND}" $'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_install'
}

Expand All @@ -22,8 +20,6 @@ function local_setup {
export PROMPT_COMMAND="$test_prompt_string"

load ../../vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh
assert_success

assert_equal "${PROMPT_COMMAND}" "$test_prompt_string"$'\n__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_install'
}

Expand All @@ -33,8 +29,6 @@ function local_setup {
export __bp_delay_install="blarg"

load ../../vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh
assert_success

assert_equal "${PROMPT_COMMAND}" "$test_prompt_string"

run __bp_install_after_session_init
Expand All @@ -49,7 +43,6 @@ function local_setup {
export PROMPT_COMMAND="$test_prompt_string"

load ../../vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh
assert_success

run __bp_install
assert_success
Expand All @@ -63,7 +56,6 @@ function local_setup {
export PROMPT_COMMAND="$test_prompt_string"

load ../../vendor/github.com/rcaloras/bash-preexec/bash-preexec.sh
assert_success

run __bp_install
assert_success
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/base.plugin.bats
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ load ../../plugins/available/base.plugin
rm -rf "${BASH_IT_ROOT}/${dir_name}"

mkcd "${dir_name}"
assert_success

assert_dir_exist "${BASH_IT_ROOT}/${dir_name}"
assert_equal "${PWD}" "${BASH_IT_ROOT//\/\///}/${dir_name}"
}
Expand Down
4 changes: 2 additions & 2 deletions test/themes/base.theme.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load ../../themes/base.theme
assert_line "function"

run battery_char
assert_line -n 0 ""
assert_output ""
}

@test 'themes base: battery_char should exist if battery plugin loaded' {
Expand Down Expand Up @@ -51,7 +51,7 @@ load ../../themes/base.theme

run battery_charge
assert_success
assert_line -n 0 ""
assert_output ""
}

@test 'themes base: battery_charge should exist if battery plugin loaded' {
Expand Down

0 comments on commit fd93628

Please sign in to comment.