From 9f6255cd425a58b2e856ad69d2300b5ed00c594b Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Mon, 21 Mar 2016 04:42:27 -0700 Subject: [PATCH] Trying to fix the tests: - slightly better alignment - more resilient test expression --- lib/helpers.bash | 2 +- test/lib/helpers.bats | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index 9f4f5b11..5d6defeb 100755 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -190,7 +190,7 @@ _bash-it-search-component() { [[ -n "$NO_COLOR" && color_off="" ]] || color_off="\e[0;0m" if [[ "${#matches[*]}" -gt 0 ]] ; then - printf "%15s: ${color_on}%s${color_off}\n" "${_component}" "$(echo -n ${matches[*]} | tr ' ' '\n' | sort | uniq | tr '\n' ' ' | sed 's/ $//g')" + printf "%-12s: ${color_on}%s${color_off}\n" "${_component}" "$(echo -n ${matches[*]} | tr ' ' '\n' | sort | uniq | tr '\n' ' ' | sed 's/ $//g')" fi unset matches } diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index f1e0f4b6..eb814199 100644 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -1,14 +1,15 @@ #!/usr/bin/env bats load ../../lib/composure +load ../../plugins/available/base.plugin + cite _about _param _example _group _author _version load ../../lib/helpers -load ../../plugins/available/base.plugin NO_COLOR=true @test "helpers search aliases" { run _bash-it-search-component 'plugins' 'base' - [[ "${lines[0]}" =~ 'plugins: base' ]] + [[ "${lines[0]}" =~ 'plugins' && "${lines[0]}" =~ 'base' ]] }