test_that_json v0.1.0 TestThatJson.Json

Summary

Functions

Receives a subject and a value and returns whether they are equal

Receives a subject and a value and returns whether the subject has all keys specified by the value

Receives a subject and a value and returns whether the subject contains only the keys specified by the value

Receives a subject and a value and returns whether the subject contains only the properties (or key value pairs) specified by the value

Receives a subject and a value and returns whether the subject contains only the values specified by the value

Receives a subject and a path and returns whether the path exists within the subject

Receives a subject and a value and returns whether the subject contains the properties (or key value pairs) specified by the value

Receives a subject and a value and returns whether the subject contains the values specified by the value

Types

Functions

equals?(subject, value)

Specs

equals?(json_value, json_value) :: boolean

Receives a subject and a value and returns whether they are equal.

has_keys?(subject, value)

Specs

has_keys?(json_object, json_array | json_string) :: boolean

Receives a subject and a value and returns whether the subject has all keys specified by the value.

has_only_keys?(subject, value)

Specs

has_only_keys?(json_object, json_array | json_string) :: boolean

Receives a subject and a value and returns whether the subject contains only the keys specified by the value.

has_only_properties?(subject, value)

Specs

has_only_properties?(json_object, json_object) :: boolean

Receives a subject and a value and returns whether the subject contains only the properties (or key value pairs) specified by the value.

has_only_values?(subject, value)

Specs

has_only_values?(json_value, json_value) :: boolean

Receives a subject and a value and returns whether the subject contains only the values specified by the value.

has_path?(subject, path)

Specs

has_path?(json_object | json_array, String.t) :: boolean

Receives a subject and a path and returns whether the path exists within the subject.

has_properties?(subject, value)

Specs

has_properties?(json_object, json_object) :: boolean

Receives a subject and a value and returns whether the subject contains the properties (or key value pairs) specified by the value.

has_values?(subject, value)

Specs

has_values?(json_value, json_value) :: boolean

Receives a subject and a value and returns whether the subject contains the values specified by the value.

If the value is a list, returns whether all values in the list are in the subject.

If the value is a JSON array as a String.t, it is not treated the same as a list. Instead, returns whether that list itself is one of the values in the subject.