Marty Oehme
ceea79eb3a
Now that the project is finding a little adoption it is really high time to bring some tests into the code to ensure everything works as it should. This first version will only provide a simple test harness from which tests can slowly be written for other parts of the program.
17 lines
531 B
Bash
17 lines
531 B
Bash
#!/usr/bin/env bash
|
|
|
|
setup() {
|
|
load 'test_helper/bats-support/load'
|
|
load 'test_helper/bats-assert/load'
|
|
|
|
# make bemoji executable from anywhere relative to current testfile
|
|
TEST_DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
|
PATH="$TEST_DIR/..:$PATH"
|
|
}
|
|
|
|
@test "test can run script" {
|
|
# closing FD3 manually to prevent hangs, see
|
|
# https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
|
|
run bemoji 3>&-
|
|
assert_success
|
|
}
|