summaryrefslogtreecommitdiff
path: root/test/lib-conf-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib-conf-test.sh')
-rw-r--r--test/lib-conf-test.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lib-conf-test.sh b/test/lib-conf-test.sh
index d79c5f2..e1a27e6 100644
--- a/test/lib-conf-test.sh
+++ b/test/lib-conf-test.sh
@@ -23,6 +23,19 @@ it_figures_out_HOME_when_root() {
[[ $LIBREHOME != /root ]]
}
+it_nests_LIBREUSER() {
+ require sudo || return 0
+ [[ $USER != root ]]
+ cd "$tmpdir"
+ echo '. $(librelib conf.sh); echo "$LIBREUSER"' > test.sh
+
+ LIBREUSER=$(testsudo bash ./test.sh)
+ [[ $LIBREUSER == "$USER" ]]
+
+ LIBREUSER=$(testsudo testsudo -u "$USER" bash ./test.sh)
+ [[ $LIBREUSER == "$USER" ]]
+}
+
it_respects_custom_HOME() {
cd "$tmpdir"
echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh