mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Fancier compare
This commit is contained in:
parent
9a58ab1000
commit
4bb5272b77
@ -24,7 +24,7 @@ compare_files() {
|
|||||||
pattern="$3"
|
pattern="$3"
|
||||||
|
|
||||||
if [ "$DEBUG" = "true" ]; then get_for_file "${expected}" >&2; fi
|
if [ "$DEBUG" = "true" ]; then get_for_file "${expected}" >&2; fi
|
||||||
diff --side-by-side --suppress-common-lines \
|
diff --side-by-side \
|
||||||
<(jq "${pattern}" -S <(get_for_file "${expected}")) \
|
<(jq "${pattern}" -S <(get_for_file "${expected}")) \
|
||||||
<(jq "${pattern}" -S <(get_for_file "${actual}"))
|
<(jq "${pattern}" -S <(get_for_file "${actual}"))
|
||||||
}
|
}
|
||||||
@ -33,4 +33,6 @@ echo
|
|||||||
echo "data"
|
echo "data"
|
||||||
compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".data"
|
compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".data"
|
||||||
echo "included"
|
echo "included"
|
||||||
compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included"
|
# compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"posts\")"
|
||||||
|
# compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"comments\")"
|
||||||
|
compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type != \"comments\", .type != \"posts\")"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user