diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index 47cb6797..af9ae6b6 100644 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -9,13 +9,14 @@ load ../../lib/helpers NO_COLOR=true -IS_DARWIN= -[[ "$(uname -s)" == "Darwin" ]] && IS_DARWIN=true - @test "helpers search aliases" { - if [ -z "$IS_DARWIN" ]; then - skip 'search test only runs on OSX' - fi run _bash-it-search-component 'plugins' 'base' [[ "${lines[0]}" =~ 'plugins' && "${lines[0]}" =~ 'base' ]] } + +@test "helpers search all ruby et al" { + run _bash-it-search 'ruby' 'gem' 'bundle' 'rake' 'rails' + [[ "${lines[0]}" == 'aliases : bundler rails' ]] + [[ "${lines[1]}" == 'plugins : chruby chruby-auto ruby' ]] + [[ "${lines[2]}" == 'completions : bundler gem rake' ]] +} diff --git a/test/run b/test/run index f626521d..397aec9c 100755 --- a/test/run +++ b/test/run @@ -1,5 +1,12 @@ #!/usr/bin/env bash -_TEST_DIR="$(cd "$(dirname "$0")" && pwd)" -_BATS="${_TEST_DIR}/../bats/bin/bats" -[ ! -e $_BATS ] && git clone --depth 1 https://github.com/sstephenson/bats.git ${_TEST_DIR}/../bats -exec $_BATS ${CI:+--tap} ${_TEST_DIR}/{lib,plugins} +test_directory="$(cd "$(dirname "$0")" && pwd)" +bats_executable="${test_directory}/../bats/bin/bats" + +[ ! -e $bats_executable ] && \ + git clone --depth 1 https://github.com/sstephenson/bats.git ${test_directory}/../bats + +if [ -z "${BASH_IT}" ]; then + export BASH_IT=$(cd ${test_directory} && dirname $(pwd)) +fi + +exec $bats_executable ${CI:+--tap} ${test_directory}/{lib,plugins}