#!/usr/bin/env roundup describe librefetch . ./test-common.sh before() { _before mkdir -p "$XDG_CONFIG_HOME"/{pacman,libretools} printf '%s\n' \ 'DLAGENTS=({https,libre}"::$(which librefetch) -p $(printf %q "${BUILDFILE:-$BUILDSCRIPT}") -- %u %o")' \ 'BUILDDIR=""' \ 'unset SRCDEST' \ > "$XDG_CONFIG_HOME/pacman/makepkg.conf" printf '%s\n' \ 'MIRRORS=("phony://example.com/dir/")' \ 'DOWNLOADER=/usr/bin/false' \ > "$XDG_CONFIG_HOME/libretools/librefetch.conf" } after() { _after } it_displays_help() { LC_ALL=C librefetch -h >$tmpdir/stdout 2>$tmpdir/stderr [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] empty $tmpdir/stderr } # This test also does a rough test of file order in the PKGBUILD 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=testpkg-1.0.tar.gz bsdtar tf "$srcball" > list-pkg.txt diff -u list.txt list-pkg.txt }