2
1
mirror of https://github.com/kdabir/has.git synced 2024-11-10 21:26:50 +01:00
has/.hastest.bats
2017-08-28 21:37:44 +05:30

20 lines
434 B
Bash

#!/usr/bin/env bats
@test "works with single command check" {
result=$(bash has node)
[[ $result == *"✔ node"* ]]
}
@test "safely tells about tools not configured" {
result=$(bash has something-missing)
[[ $result == *"✘ something-missing not understood"* ]]
}
@test "env lets override safety check" {
result=$(HAS_ALLOW_UNSAFE=y bash has something-missing)
[[ $result == *"✘ something-missing"* ]]
}