command -v rsync > /dev/null \
|| errlog "command rsync not found" \
|| return $?
+
+ CONFIG_FILE=${CONFIG_FILE:="$HOME/.albentohandy.conf"}
+
+ [ -f "$CONFIG_FILE" ] \
+ || errlog "missing $CONFIG_FILE" \
+ || return $?
}
[ "$TEST_MODE" == "ON" ] && return 0
bats_load_library 'bats-support'
bats_load_library 'bats-assert'
export TEST_MODE="ON"
+ export CONFIG_FILE="src/albentohandy.conf"
source src/albentohandy
}
assert_failure
assert_line --index 0 "❌ ERROR: command rsync not found"
+}
+
+@test "failed: missing albumtohandy.conf" {
+ CONFIG_FILE="src/nothing.conf"
+
+ run main
+
+ assert_failure
+ assert_line --index 0 "❌ ERROR: missing src/nothing.conf"
}
\ No newline at end of file