docs, test: add config management documentation and tests
Test PR / test (pull_request) Successful in 6s
Release on Merge / release (pull_request) Successful in 6s

This commit is contained in:
2026-05-02 23:33:23 -04:00
parent 1129563000
commit 616aa6f2f1
2 changed files with 37 additions and 0 deletions
+18
View File
@@ -150,6 +150,24 @@ else
echo "FAIL (notify.log not created)"
fi
# 8. Config Management
it "manages configuration via CLI"
mkdir -p "$HOME/.config/color-tool"
"$COLOR_TOOL" --reset-config >/dev/null
# Test --set-config
"$COLOR_TOOL" --set-config defaults output=rgba
output=$("$COLOR_TOOL" --get-config)
if [[ "$output" == *"output = \"rgba\""* ]]; then
# Test --reset-config
"$COLOR_TOOL" --reset-config >/dev/null
output=$("$COLOR_TOOL" --get-config)
assert_contains "$output" "output = \"hex\""
else
echo "FAIL"
echo " Expected to find: output = \"rgba\""
echo " Actual output: $output"
fi
# 9. JSON Output
it "outputs selected formats as JSON"