aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wallp.bats28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
new file mode 100644
index 0000000..b92b3c2
--- /dev/null
+++ b/tests/wallp.bats
@@ -0,0 +1,28 @@
+#!/usr/bin/env bats
+
+setup() {
+ SCRIPT_DIR="$(cd "$BATS_TEST_DIRNAME/.." && pwd)"
+ TMP_HOME="$(mktemp -d)"
+ export HOME="$TMP_HOME"
+ STUB_DIR="$TMP_HOME/stubs"
+ mkdir -p "$STUB_DIR"
+ export PATH="$STUB_DIR:$PATH"
+ local bin
+ for bin in swaybg wal qarma notify-send pkill kill; do
+ cat > "$STUB_DIR/$bin" <<EOF
+#!/bin/bash
+echo "$bin \$*" >> "$TMP_HOME/calls.log"
+exit 0
+EOF
+ chmod +x "$STUB_DIR/$bin"
+ done
+ source "$SCRIPT_DIR/wallp"
+}
+
+teardown() {
+ rm -rf "$TMP_HOME"
+}
+
+@test "harness sanity" {
+ [ "x" = "x" ]
+}