#!/usr/bin/env bats # lint-org.el must load standalone via `emacs --batch -q -l ` with no # -L flag — that's how wrap-it-up and the /lint-org command invoke it. The # require of wrap-org-table broke that once: the dependency resolved under # make test's -L .ai/scripts but not from a bare -l load. setup() { SCRIPTS_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" TMPFILE="$(mktemp --suffix=.org)" printf '* H\n\n| a |\n|---|\n| ok |\n|---|\n' > "$TMPFILE" } teardown() { rm -f "$TMPFILE" } @test "lint-org.el loads and runs without -L on the load path" { run emacs --batch -q -l "$SCRIPTS_DIR/lint-org.el" --check "$TMPFILE" [ "$status" -eq 0 ] [[ "$output" == *"lint-org: file="* ]] } @test "wrap-org-table.el loads and runs without -L on the load path" { run emacs --batch -q -l "$SCRIPTS_DIR/wrap-org-table.el" --width=120 "$TMPFILE" [ "$status" -eq 0 ] [[ "$output" == *"reformatted"* ]] }