summaryrefslogtreecommitdiff
path: root/test/aur-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/aur-test.sh')
-rw-r--r--test/aur-test.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/aur-test.sh b/test/aur-test.sh
new file mode 100644
index 0000000..1cbcc57
--- /dev/null
+++ b/test/aur-test.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env roundup
+
+describe aur
+
+before() {
+ tmpdir=$(mktemp -d --tmpdir test-aur.XXXXXXXXXXXX)
+ stat=0
+}
+
+after() {
+ rm -rf -- "$tmpdir"
+}
+
+it_displays_help() {
+ aur -h >$tmpdir/stdout 2>$tmpdir/stderr
+
+ [[ "$(sed 1q $tmpdir/stdout)" =~ Usage:.* ]]
+ [[ -z "$(cat $tmpdir/stderr)" ]]
+}
+
+it_fails_with_0_args() {
+ aur >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
+
+ [[ $stat != 0 ]]
+ [[ -z "$(cat $tmpdir/stdout)" ]]
+ [[ -n "$(cat $tmpdir/stderr)" ]]
+}
+
+# TODO: I don't have any other tests we can run without networking.