#!/usr/bin/env roundup describe lib/conf.sh . ./test-common.sh before() { _before test-conf.sh } after() { _after } it_sets_makepkg_vars_in_custom_file() { unset PKGDEST touch "$tmpdir/makepkg.conf" . $(librelib conf.sh) MAKEPKG_CONF="$tmpdir/makepkg.conf" set_conf_makepkg PKGDEST /pkgdest . "$tmpdir/makepkg.conf" [[ $PKGDEST == /pkgdest ]] } it_figures_out_HOME_when_root() { require sudo || return 0 cd "$tmpdir" echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh LIBREHOME=$(sudo -EH bash ./test.sh) [[ $LIBREHOME == $HOME ]] } it_respects_custom_HOME() { cd "$tmpdir" echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh export HOME=/foo LIBREHOME=$(bash ./test.sh) [[ $LIBREHOME == /foo ]] }