mirror of https://github.com/kdabir/has.git
add basic tests and travis config
This commit is contained in:
parent
f3329d3d08
commit
c4695a0bdd
|
@ -0,0 +1,19 @@
|
|||
#!/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"* ]]
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
language: bash
|
||||
before_install:
|
||||
- sudo add-apt-repository ppa:duggan/bats --yes
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq bats
|
||||
install:
|
||||
- sudo apt-get install -qq bc
|
||||
script:
|
||||
- bats .hastest.bats
|
Loading…
Reference in New Issue