From 3838f1249825d3516fcc7825f74b8a962863a40c Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Wed, 21 Oct 2020 11:02:55 +0300 Subject: [PATCH] Add tests for _binary_exists --- test/lib/helpers.bats | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/lib/helpers.bats b/test/lib/helpers.bats index 70481b32..0a58be34 100644 --- a/test/lib/helpers.bats +++ b/test/lib/helpers.bats @@ -39,6 +39,26 @@ function local_setup { assert_failure } +@test "helpers: _binary_exists function exists" { + run type -a _binary_exists &> /dev/null + assert_success +} + +@test "helpers: _binary_exists function positive test ls" { + run _binary_exists ls + assert_success +} + +@test "helpers: _binary_exists function negative test function" { + run _binary_exists _binary_exists + assert_failure +} + +@test "helpers: _binary_exists function negative test" { + run _binary_exists __addfkds_dfdsjdf + assert_failure +} + @test "helpers: bash-it help aliases ag" { run bash-it help aliases "ag" assert_line -n 0 "ag='ag --smart-case --pager=\"less -MIRFX'"