diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..b7efcb4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "test/bats"] + path = test/bats + url = https://github.com/bats-core/bats-core.git +[submodule "test/test_helper/bats-support"] + path = test/test_helper/bats-support + url = https://github.com/bats-core/bats-support.git +[submodule "test/test_helper/bats-assert"] + path = test/test_helper/bats-assert + url = https://github.com/bats-core/bats-assert.git diff --git a/test/bats b/test/bats new file mode 160000 index 0000000..26c9b18 --- /dev/null +++ b/test/bats @@ -0,0 +1 @@ +Subproject commit 26c9b18983c3ce4cf24c6f6ee942abd8b1c3ee18 diff --git a/test/bemoji.bats b/test/bemoji.bats new file mode 100644 index 0000000..ad9936d --- /dev/null +++ b/test/bemoji.bats @@ -0,0 +1,17 @@ +#!/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 +} diff --git a/test/test_helper/bats-assert b/test/test_helper/bats-assert new file mode 160000 index 0000000..ffe84ea --- /dev/null +++ b/test/test_helper/bats-assert @@ -0,0 +1 @@ +Subproject commit ffe84ea5dd43b568851549b3e241db150c12929c diff --git a/test/test_helper/bats-support b/test/test_helper/bats-support new file mode 160000 index 0000000..3c8fadc --- /dev/null +++ b/test/test_helper/bats-support @@ -0,0 +1 @@ +Subproject commit 3c8fadc5097c9acfc96d836dced2bb598e48b009