diff options
Diffstat (limited to 'test/libredbdiff-test.sh')
-rw-r--r-- | test/libredbdiff-test.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/libredbdiff-test.sh b/test/libredbdiff-test.sh new file mode 100644 index 0000000..1b267e3 --- /dev/null +++ b/test/libredbdiff-test.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env roundup + +describe libredbdiff +. ./test-common.sh + +common_before() { + mkdir -p "$XDG_CONFIG_HOME/libretools" + printf '%s\n' \ + 'statedir="$PWD"' \ + "mirror='http://repo.parabola.nu/\$repo/os/\$arch'" \ + "mirrorarch='http://mirrors.kernel.org/archlinux/\$repo/os/\$arch'" \ + > $XDG_CONFIG_HOME/libretools/libredbdiff.conf +} + +it_displays_help() { + LC_ALL=C libredbdiff -h >$tmpdir/stdout 2>$tmpdir/stderr + + [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]] + empty $tmpdir/stderr +} + +it_handles_packages_with_multiple_provides() { + cd libredbdiff.d/statedir + + libredbdiff -n libre >$tmpdir/stdout 2>$tmpdir/stderr + + empty $tmpdir/stderr + diff -w ../expected.txt $tmpdir/stdout +} |