From a329839346a3c2c9591985b70841858dd575846f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 4 Jun 2013 22:02:21 -0600 Subject: add a system to skip tests that require networking or sudo. --- test/lib-conf-test.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/lib-conf-test.sh') 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 -- cgit v1.2.2