diff options
| author | danix <danix@danix.xyz> | 2026-06-11 09:42:37 +0200 |
|---|---|---|
| committer | danix <danix@danix.xyz> | 2026-06-11 09:42:37 +0200 |
| commit | 5f100a9a1a8e194f05ddace1b4a147c16abab8d5 (patch) | |
| tree | f1d78585f93d3d7975d627c3fa61f7aab6d76e3b /tests | |
| parent | df190f46cda798fac6e7d5c5045c2c4cd2f5041e (diff) | |
| download | wallp-5f100a9a1a8e194f05ddace1b4a147c16abab8d5.tar.gz wallp-5f100a9a1a8e194f05ddace1b4a147c16abab8d5.zip | |
test: bats setup/teardown + sourceable wallp stub
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/wallp.bats | 28 |
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" ] +} |
