summaryrefslogtreecommitdiff
path: root/test/libreblacklist-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-01 11:56:57 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 19:53:57 -0600
commite1e82671870076a73766e628f8755a1f7e0afe11 (patch)
treec38bf676bb34d73de5af3891e3648a5e6f15e62c /test/libreblacklist-test.sh
parent47722999c8cb00e6f0be036aa8b620fcd0ca861c (diff)
reorganize the tests a bit
Diffstat (limited to 'test/libreblacklist-test.sh')
-rw-r--r--test/libreblacklist-test.sh69
1 files changed, 0 insertions, 69 deletions
diff --git a/test/libreblacklist-test.sh b/test/libreblacklist-test.sh
deleted file mode 100644
index 94f5b27..0000000
--- a/test/libreblacklist-test.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env roundup
-
-describe libreblacklist
-
-before() {
- tmpdir=$(mktemp -d --tmpdir test-libreblacklist.XXXXXXXXXXXX)
- stat=0
-}
-
-after() {
- rm -rf -- "$tmpdir" "$XDG_CACHE_HOME" "$XDG_CONFIG_HOME"
-}
-
-it_works_with_just_pkgname() {
- v="$(libreblacklist normalize <<<skype)"; [[ $v == 'skype::' ]]
- v="$(libreblacklist get-pkg <<<skype)"; [[ $v == skype ]]
- v="$(libreblacklist get-rep <<<skype)"; [[ -z $v ]]
- v="$(libreblacklist get-reason <<<skype)"; [[ -z $v ]]
-}
-
-it_works_with_everything_set() {
- line='linux:linux-libre:nonfree blobs and firmwares'
- v="$(libreblacklist normalize <<<"$line")"; [[ $v == "$line" ]]
- v="$(libreblacklist get-pkg <<<"$line")"; [[ $v == 'linux' ]]
- v="$(libreblacklist get-rep <<<"$line")"; [[ $v == 'linux-libre' ]]
- v="$(libreblacklist get-reason <<<"$line")"; [[ $v == 'nonfree blobs and firmwares' ]]
-}
-
-it_normalizes_correctly() {
- v="$(libreblacklist normalize <<<pkg)"; [[ $v == 'pkg::' ]]
- v="$(libreblacklist normalize <<<pkg:)"; [[ $v == 'pkg::' ]]
- v="$(libreblacklist normalize <<<pkg::)"; [[ $v == 'pkg::' ]]
- v="$(libreblacklist normalize <<<pkg:rep)"; [[ $v == 'pkg:rep:' ]]
- v="$(libreblacklist normalize <<<pkg:rep:)"; [[ $v == 'pkg:rep:' ]]
- v="$(libreblacklist normalize <<<pkg:rep:reason)"; [[ $v == 'pkg:rep:reason' ]]
- v="$(libreblacklist normalize <<<pkg:rep:reason:)"; [[ $v == 'pkg:rep:reason:' ]]
-}
-
-it_works_with_colons_in_reason() {
- line='package:replacement:my:reason'
- v="$(libreblacklist normalize <<<"$line")"; [[ $v == "$line" ]]
- v="$(libreblacklist get-pkg <<<"$line")"; [[ $v == 'package' ]]
- v="$(libreblacklist get-rep <<<"$line")"; [[ $v == 'replacement' ]]
- v="$(libreblacklist get-reason <<<"$line")"; [[ $v == 'my:reason' ]]
-}
-
-it_fails_update_when_there_is_no_blacklist_or_network() {
- mkdir -p $XDG_CONFIG_HOME/libretools
- echo "BLACKLIST='http://phony'" >$XDG_CONFIG_HOME/libretools/libretools.conf
-
- libreblacklist update >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
-
- [[ $stat != 0 ]]
- [[ -z "$(cat $tmpdir/stdout)" ]]
- [[ -n "$(cat $tmpdir/stderr)" ]]
-}
-
-it_fails_cat_when_there_is_no_blacklist_or_network() {
- mkdir -p $XDG_CONFIG_HOME/libretools
- echo "BLACKLIST='http://phony'" >$XDG_CONFIG_HOME/libretools/libretools.conf
-
- libreblacklist cat >$tmpdir/stdout 2>$tmpdir/stderr || stat=$?
-
- [[ $stat != 0 ]]
- [[ -z "$(cat $tmpdir/stdout)" ]]
- [[ -n "$(cat $tmpdir/stderr)" ]]
-}
-
-# TODO: test blacklist-update, but I don't want tests to use network