diff options
Diffstat (limited to 'test/cases/toru-path.bats')
-rw-r--r-- | test/cases/toru-path.bats | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/test/cases/toru-path.bats b/test/cases/toru-path.bats index 5576ad7..d891d3d 100644 --- a/test/cases/toru-path.bats +++ b/test/cases/toru-path.bats @@ -1,22 +1,19 @@ -#!/usr/bin/env roundup +load ../lib/common -describe toru-path -. ./test-common.sh - -it_displays_help() { +@test "toru-path displays help" { LC_ALL=C toru-path -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr } -it_runs() { +@test "toru-path runs" { cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot TORUPATH=${tmpdir@Q} REPOS=(libre) eot cat >> "$HOME/.abs.conf" <<-eot - ABSROOT=${PWD@Q}/toru.d + ABSROOT=${PWD@Q}/fixtures/toru eot toru-path @@ -27,26 +24,26 @@ it_runs() { done > "$tmpdir/paths-actual.txt" printf '«%q» -> «%q»\n' \ - BAR "$PWD/toru.d/libre/split-base" \ - BAZ "$PWD/toru.d/libre/split-base" \ - FOO "$PWD/toru.d/libre/split-base" \ - bar "$PWD/toru.d/libre/split" \ - baz "$PWD/toru.d/libre/split" \ - foo "$PWD/toru.d/libre/split" \ - simple "$PWD/toru.d/libre/simple" \ - split-base "$PWD/toru.d/libre/split-base" \ + BAR "$PWD/fixtures/toru/libre/split-base" \ + BAZ "$PWD/fixtures/toru/libre/split-base" \ + FOO "$PWD/fixtures/toru/libre/split-base" \ + bar "$PWD/fixtures/toru/libre/split" \ + baz "$PWD/fixtures/toru/libre/split" \ + foo "$PWD/fixtures/toru/libre/split" \ + simple "$PWD/fixtures/toru/libre/simple" \ + split-base "$PWD/fixtures/toru/libre/split-base" \ > "$tmpdir/paths-expected.txt" diff "$tmpdir/paths-expected.txt" "$tmpdir/paths-actual.txt" } -it_sets_torupath() { +@test "toru-path sets torupath" { cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot TORUPATH=${tmpdir@Q} REPOS=(libre) eot cat >> "$HOME/.abs.conf" <<-eot - ABSROOT=${PWD@Q}/toru.d + ABSROOT=${PWD@Q}/fixtures/toru eot mkdir -p "$tmpdir/x" |