diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-26 23:16:13 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-10-26 23:16:13 -0400 |
commit | 11ca293c188ad394e2383381a4bce152cc7f0723 (patch) | |
tree | 6c9e7c3ae88f209c4f5d5ae0cb09b894f4682d86 /test/librefetch-test.sh | |
parent | fe48444f1d1f2eadbaabf14fc331ce6b28c74cce (diff) |
fix librefetch, add (some) tests for itv20131027
Diffstat (limited to 'test/librefetch-test.sh')
-rw-r--r-- | test/librefetch-test.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh new file mode 100644 index 0000000..7408993 --- /dev/null +++ b/test/librefetch-test.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env roundup + +describe librefetch + +. ./test-common.sh + +before() { + _before + + mkdir -p "$HOME" + printf '%s\n' \ + "DLAGENTS+=(\"libre::$(which librefetch) -p \\\"\\\$BUILDFILE\\\" %u %o\")" \ + 'BUILDDIR=""' \ + > "$HOME/.makepkg.conf" + + mkdir -p "$XDG_CONFIG_HOME/libretools" + printf '%s\n' \ + 'MIRROR="phony://example.com/dir/"' \ + 'DOWNLOADER=/usr/bin/false' \ + > "$XDG_CONFIG_HOME/libretools/librefetch.conf" +} + +after() { + _after +} + +it_displays_help() { + LANG=C librefetch -h >$tmpdir/stdout 2>$tmpdir/stderr + + [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] + empty $tmpdir/stderr +} + +it_cleans_src_libre_first() { + cp librefetch.d/* "$tmpdir/" + cd "$tmpdir" + + # create garbage + mkdir -p src-libre/foo + touch src-libre/foo/file + + # run librefetch + makepkg -g + + srcball=src/testpkg-1.0.tar.gz + bsdtar tf "$srcball" > list-pkg.txt + diff -u list.txt list-pkg.txt +} |