diff options
Diffstat (limited to 'test/cases/lib-conf.bats')
-rw-r--r-- | test/cases/lib-conf.bats | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/test/cases/lib-conf.bats b/test/cases/lib-conf.bats index cf0b805..0925640 100644 --- a/test/cases/lib-conf.bats +++ b/test/cases/lib-conf.bats @@ -1,9 +1,6 @@ -#!/usr/bin/env roundup +load ../lib/common -describe lib/conf.sh -. ./test-common.sh - -it_sets_makepkg_vars_in_custom_file() { +@test "lib/conf.sh sets makepkg vars in custom file" { unset PKGDEST touch "$tmpdir/makepkg.conf" bash -c "$(printf '. $(librelib conf.sh); MAKEPKG_CONF=%q set_var makepkg PKGDEST /pkgdest' "$tmpdir/makepkg.conf")" @@ -11,8 +8,8 @@ it_sets_makepkg_vars_in_custom_file() { [[ $PKGDEST == /pkgdest ]] } -it_figures_out_HOME_when_root() { - require sudo || return 0 +@test "lib/conf.sh figures out HOME when root" { + require sudo || skip # This one is tricky, because it does the job too well, it will find # the actual HOME, instead of the test environment HOME. Therefore, we # will just check that [[ $HOME != /root ]] @@ -22,8 +19,8 @@ it_figures_out_HOME_when_root() { [[ $LIBREHOME != /root ]] } -it_nests_LIBREUSER() { - require sudo || return 0 +@test "lib/conf.sh nests LIBREUSER" { + require sudo || skip [[ $USER != root ]] cd "$tmpdir" echo '. $(librelib conf.sh); echo "$LIBREUSER"' > test.sh @@ -35,7 +32,7 @@ it_nests_LIBREUSER() { [[ $LIBREUSER == "$USER" ]] } -it_respects_custom_HOME() { +@test "lib/conf.sh respects custom HOME" { cd "$tmpdir" echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh |