adding tests and travis yml

pull/130/head
Maciek Swiech 2020-05-31 22:31:09 -06:00
parent cd878c2cb5
commit 8f4a00f727
5 changed files with 31 additions and 8 deletions

10
.travis.yml Normal file
View File

@ -0,0 +1,10 @@
udo: false
language: bash
addons:
apt:
sources:
- sourceline: 'ppa:duggan/bats'
packages:
- bats
- bc
script: bats ./test/*.bats

3
test.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
./test/libs/bats/bin/bats test/*.bats

17
test/basic_test.bats Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bats
load 'libs/bats-support/load'
load 'libs/bats-assert/load'
load test_helper
@test "sourcing works, by checking if $system is set" {
run echo $system
refute_output ""
}
@test "#get_themes populates themes" {
get_themes
assert_success
assert [ ${#themes[@]} -gt 0 ]
}

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bats
source bashtop
@test "im a toy" {
result=$(echo hello)
[ "$result" = "hello" ]
}

1
test/test_helper.bash Normal file
View File

@ -0,0 +1 @@
source bashtop