summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-01 16:44:27 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 20:01:05 -0600
commit8e4f38133dc6b0a91d16ac5a7a3ff78ba1e24727 (patch)
tree973a2adc7628b2a680e08b833fa5dfbccbf24427 /test
parentc129ad75fceba7eb980874bb15954a1889d1f33a (diff)
lib/conf.sh: respect a customized HOME variable
Diffstat (limited to 'test')
-rw-r--r--test/lib-conf-test.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lib-conf-test.sh b/test/lib-conf-test.sh
index bb6b285..eeea287 100644
--- a/test/lib-conf-test.sh
+++ b/test/lib-conf-test.sh
@@ -20,3 +20,21 @@ it_sets_makepkg_vars_in_custom_file() {
. "$tmpdir/makepkg.conf"
[[ $PKGDEST == /pkgdest ]]
}
+
+it_figures_out_HOME_when_root() {
+ cd "$tmpdir"
+ echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh
+
+ LIBREHOME=$(sudo 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 ]]
+}