summaryrefslogtreecommitdiff
path: root/test/lib-conf-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-04 22:02:21 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 20:06:25 -0600
commita329839346a3c2c9591985b70841858dd575846f (patch)
treeb7cbde15e7e46d42726058b9e318ce6a8e85c29c /test/lib-conf-test.sh
parent695b9b8af8e2629d460d877abab4bdf216c71df2 (diff)
add a system to skip tests that require networking or sudo.
Diffstat (limited to 'test/lib-conf-test.sh')
-rw-r--r--test/lib-conf-test.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/lib-conf-test.sh b/test/lib-conf-test.sh
index 0ee0f62..86c11c6 100644
--- a/test/lib-conf-test.sh
+++ b/test/lib-conf-test.sh
@@ -2,16 +2,16 @@
describe lib/conf.sh
+. ./test-common.sh
+
before() {
- tmpdir=$(mktemp -d --tmpdir test-conf.sh.XXXXXXXXXXXX)
- stat=0
+ _before test-conf.sh
}
after() {
- rm -rf -- "$tmpdir" "$XDG_CACHE_HOME" "$XDG_CONFIG_HOME"
+ _after
}
-
it_sets_makepkg_vars_in_custom_file() {
unset PKGDEST
touch "$tmpdir/makepkg.conf"
@@ -22,6 +22,7 @@ it_sets_makepkg_vars_in_custom_file() {
}
it_figures_out_HOME_when_root() {
+ require sudo || return 0
cd "$tmpdir"
echo '. $(librelib conf.sh); echo "$LIBREHOME"' > test.sh