feat: add json format support to ssh-keys:list

This commit is contained in:
Jose Diaz-Gonzalez
2020-12-19 17:20:54 -05:00
parent 13dd8aa224
commit 18492ac83c
4 changed files with 221 additions and 3 deletions

View File

@@ -78,6 +78,15 @@ assert_equal() {
fi
}
assert_not_equal() {
if [[ "$1" == "$2" ]]; then
{
echo "unexpected: $1"
echo "actual: $2"
} | flunk
fi
}
# ShellCheck doesn't know about $output from Bats
# shellcheck disable=SC2154
assert_output() {
@@ -90,6 +99,18 @@ assert_output() {
assert_equal "$expected" "$output"
}
# ShellCheck doesn't know about $output from Bats
# shellcheck disable=SC2154
assert_not_output() {
local expected
if [[ $# -eq 0 ]]; then
unexpected="$(cat -)"
else
unexpected="$1"
fi
assert_not_equal "$unexpected" "$output"
}
# ShellCheck doesn't know about $output from Bats
# shellcheck disable=SC2154
assert_output_exists() {