]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add default lib variable develop
authorBastian Dehn <hhaalo@arcor.de>
Thu, 29 Oct 2026 09:38:13 +0000 (10:38 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 29 Oct 2026 09:38:13 +0000 (10:38 +0100)
src/albentohandy
src/albentohandy.conf
tests/albentohandy.bats

index b1821efa97c811c184387b6226e668d8442b4fcd..7a95d49ca06839c2fdd8c7be1b7f8844cca85232 100755 (executable)
@@ -138,7 +138,7 @@ calc_checksum()
 main()
 {
        local albumlist="albumlist"
-       local lib="vorbis.sh"
+       local lib="${DEFAULT_LIB:="vorbis"}.sh"
        check_programs || return $?
        load_config || return $?
 
index f546afc3e079bbef481b557d59a675cb77322d6f..a4fd75de0257da2b045be67a1fc8ef06d25cb271 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 MUSIC_PATH="$HOME/Music"
+# DEFAULT_LIB="vorbis"
 # BITRATE="192"
 # QUALITY="6"
 # OUTPUT_PATH=
index 26ae608940e3053787c2843fea6bcb1c6c14c008..31345141c88e263b0e95f477da1c7fb1efd5a829 100755 (executable)
@@ -113,6 +113,20 @@ teardown() {
        assert_line --index 0 "❌ ERROR: lib build/tests/lib1/vorbis.sh not found"
 }
 
+# bats test_tags=albentohandy:load_library,albentohandy:options
+@test "failed: lib mp3.sh not found when default mp3" {
+       load_config() {
+               :
+       }
+       LIB_PATH="build/tests/lib1"
+       DEFAULT_LIB="mp3"
+
+       run main
+
+       assert_failure
+       assert_line --index 0 "❌ ERROR: lib build/tests/lib1/mp3.sh not found"
+}
+
 # bats test_tags=albentohandy:load_library,albentohandy:options
 @test "failed: lib vorbis.sh not found with param" {
        load_config() {