summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:14:49 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:25:05 -0400
commit326e045c879d7ee878dece305b6c5b43dc3a18db (patch)
tree78338891e6fbbde89587d5a1b280b073dbf505ad
parent14027570984112999aafacc0603d7843cd5a655f (diff)
bugfix [1/2]: librefetch: Add a check for failing with bogus flags
-rw-r--r--test/librefetch-test.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/librefetch-test.sh b/test/librefetch-test.sh
index b4be051..f9041db 100644
--- a/test/librefetch-test.sh
+++ b/test/librefetch-test.sh
@@ -48,6 +48,20 @@ it_displays_help() {
empty $tmpdir/stderr
}
+it_fails_with_bad_flags() {
+ local srcball=testpkg-1.0.tar.gz
+ cp librefetch.d/* "$tmpdir/"
+ cd "$tmpdir"
+ mv PKGBUILD{-mksource,}
+
+ librefetch --bogus-flag libre://"$srcball" >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
+
+ [[ $stat != 0 ]]
+ empty $tmpdir/stdout
+ not empty $tmpdir/stderr
+ not test -e $tmpdir/srcdest/$srcball
+}
+
# This test used to be called "it_cleans_src_libre_first", but let's
# be honest: it checks pretty much everything related to normal
# operation.