#!/bin/bash exname=$(basename $0) prefix_cmd=" . /etc/shlib include common include parse . ../lib/common " # mock cfg-get-value() { local key="$1" shyaml get-value "$key" 2>/dev/null } export -f cfg-get-value yaml_get_interpret() { shyaml get-value } export -f yaml_get_interpret ## ## Tests ## try " _get_custom_rules ' '" noerror is out '' try " _get_custom_rules ' apache-custom-rules: '" noerror is out '' try " _get_custom_rules ' apache-custom-rules: - a - b '" noerror is out 'a b' try " _get_custom_rules ' apache-custom-rules: a: x b: y '" noerror is out ' x y'