summaryrefslogtreecommitdiff
path: root/test/lib-blacklist-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib-blacklist-test.sh')
-rw-r--r--test/lib-blacklist-test.sh18
1 files changed, 5 insertions, 13 deletions
diff --git a/test/lib-blacklist-test.sh b/test/lib-blacklist-test.sh
index 920e99d..32d700d 100644
--- a/test/lib-blacklist-test.sh
+++ b/test/lib-blacklist-test.sh
@@ -3,8 +3,6 @@
describe libreblacklist
. ./test-common.sh
-_blacklist_url=https://projects.parabola.nu/blacklist.git/plain/blacklist.txt
-
it_works_with_just_pkgname() {
v="$(libreblacklist normalize <<<skype)"; [[ $v == 'skype::::' ]]
v="$(libreblacklist get-pkg <<<skype)"; [[ $v == skype ]]
@@ -51,7 +49,7 @@ it_prints_urls_only_for_valid_references() {
}
it_fails_update_with_no_blacklist_or_network() {
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
BLACKLIST='phony://example.com'
eot
@@ -63,7 +61,7 @@ it_fails_update_with_no_blacklist_or_network() {
}
it_fails_cat_with_no_blacklist_or_network() {
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
BLACKLIST='phony://example.com'
eot
@@ -75,7 +73,7 @@ it_fails_cat_with_no_blacklist_or_network() {
}
it_fails_update_when_BLACKLIST_is_unset() {
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
BLACKLIST=
eot
@@ -88,8 +86,8 @@ it_fails_update_when_BLACKLIST_is_unset() {
it_fails_cat_when_syntax_error_in_conf() {
# there is a stray single quote in there
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
- BLACKLIST='${_blacklist_url@Q}
+ cat >> "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
+ BLACKLIST='https://git.parabola.nu/blacklist.git/plain/blacklist.txt
eot
libreblacklist cat >$tmpdir/stdout 2>$tmpdir/stderr || status=$?
@@ -101,9 +99,6 @@ it_fails_cat_when_syntax_error_in_conf() {
it_downloads_the_blacklist_as_needed() {
require network || return 0
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
- BLACKLIST=${_blacklist_url@Q}
- eot
libreblacklist cat >$tmpdir/stdout 2>$tmpdir/stderr
@@ -112,9 +107,6 @@ it_downloads_the_blacklist_as_needed() {
it_downloads_the_blacklist_repeatedly() {
require network || return 0
- install -Dm644 /dev/stdin "$XDG_CONFIG_HOME/libretools/libretools.conf" <<-eot
- BLACKLIST=${_blacklist_url@Q}
- eot
libreblacklist update
libreblacklist update