fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

68 lines
604 B

#!/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'