diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-02 15:55:01 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-05 20:01:07 -0600 |
commit | 0615f9f304be0cebc72e5a7bbcb93e8f2220e672 (patch) | |
tree | e8fa31685e81de8152feb84afa44f4a113b46556 /test/aur-test.sh | |
parent | bad38c5549a60b32f236e076dda501e9985391cb (diff) |
add unit tests for aur and is_built
Diffstat (limited to 'test/aur-test.sh')
-rw-r--r-- | test/aur-test.sh | 29 |
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. |