]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add test config
authorBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 07:40:46 +0000 (09:40 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 25 Sep 2026 07:41:14 +0000 (09:41 +0200)
tests/albentohandy.bats
tests/test.conf [new file with mode: 0644]

index 5366a4c2122bb816025c5758f5ccdec7a9115a2e..cb25d390b44b0f346219f2e6053f60fe63da5555 100755 (executable)
@@ -5,8 +5,7 @@ setup() {
        bats_load_library 'bats-assert'
        mkdir --parents "build/tests"
        export TEST_MODE="ON"
-       export CONFIG_FILE="build/tests/albentohandy.conf"
-       echo "MUSIC_PATHES=(\"build/tests\")" > "$CONFIG_FILE"
+       export CONFIG_FILE="tests/test.conf"
        source src/albentohandy
 }
 
@@ -27,16 +26,17 @@ teardown() {
 }
 
 @test "failed: missing albumtohandy.conf" {
-       CONFIG_FILE="src/nothing.conf"
+       CONFIG_FILE="build/tests/nothing.conf"
 
        run main
 
        assert_failure
-       assert_line --index 0 "❌ ERROR: missing src/nothing.conf"
+       assert_line --index 0 "❌ ERROR: missing build/tests/nothing.conf"
 }
 
 @test "failed: missing MUSIC_PATHES" {
-       echo "" > build/tests/albentohandy.conf
+       CONFIG_FILE="build/tests/albentohandy.conf"
+       echo "" > "$CONFIG_FILE"
 
        run main
 
diff --git a/tests/test.conf b/tests/test.conf
new file mode 100644 (file)
index 0000000..a169f04
--- /dev/null
@@ -0,0 +1,2 @@
+MUSIC_PATHES=("build/tests/music")
+LIB_PATH="src/lib"
\ No newline at end of file