Merge branch 'tests-must-work' of https://github.com/kigster/bash-it into kigster-tests-must-work

pull/696/head
Nils Winkler 2016-04-02 19:15:31 +02:00
commit e0035e5f61
2 changed files with 18 additions and 10 deletions

View File

@ -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' ]]
}

View File

@ -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}