]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add load example config file
authorBastian Dehn <hhaalo@arcor.de>
Tue, 4 Aug 2026 13:23:43 +0000 (15:23 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 4 Aug 2026 13:23:43 +0000 (15:23 +0200)
tests/backup_tests.bats

index 511ad44fad636c214229efb47258efe78aa9ae93..32b5635001e9267da26f08438139c7f83fa6e819 100755 (executable)
@@ -4,6 +4,7 @@ setup() {
        bats_load_library 'bats-support'
        bats_load_library 'bats-assert'
        export TESTMODE="ON"
+       export CONFIG_FILE="src/config-example.yaml"
        source src/backup
        exists_config_file() {
                return 0
@@ -12,21 +13,16 @@ setup() {
 
 teardown() {
        unset TESTMODE
+       unset CONFIG_FILE
 }
 
 @test "backup run success" {
-       yq() {
-               return 0
-       }
        run main
 
        assert_success
 }
 
 @test "show start message" {
-       yq() {
-               return 0
-       }
        run main
 
        assert_success
@@ -101,5 +97,5 @@ teardown() {
        run main
 
        assert_line --index 0 "⭐ START: backup"
-       assert_line --index 1 "❌ ERROR: failed to load config.yaml"
+       assert_line --index 1 "❌ ERROR: failed to load src/config-example.yaml"
 }
\ No newline at end of file