Valentin Lab
6 years ago
2 changed files with 73 additions and 2 deletions
@ -0,0 +1,68 @@ |
|||
#!/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' |
|||
|
|||
|
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue