Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Equality assertions for json_path #34

Merged
merged 5 commits into from
Mar 28, 2023
Merged

Add Equality assertions for json_path #34

merged 5 commits into from
Mar 28, 2023

Conversation

theredfish
Copy link
Owner

No description provided.

@theredfish theredfish added this to the 0.5.0 milestone Feb 17, 2023
@theredfish theredfish self-assigned this Feb 17, 2023
We separate json path assertions from the body DSL.
This commit adds a new method json_path and implements
the `Equality` trait.

Also bring a new way to format logs for json path that can
be later propagated to the other assertions.
src/dsl/json_path.rs Outdated Show resolved Hide resolved
src/assertion/mod.rs Outdated Show resolved Hide resolved
Also fix how the results were handled. We always need to wrap
the user input in an array to match how the jsonpath lib manages
the query results.
@theredfish theredfish changed the title First naive impl of json_path Add Equality assertions for json_path Mar 28, 2023
@theredfish theredfish marked this pull request as ready for review March 28, 2023 11:47
Users can now assert on json path result. For example:
`json_path("$.shop.total", is(json!(4)))`.

Also update the log settings to handle both unit and compound
assertions for all predicates. Json path introduced some
complexity in the log messages that should be better handle later
through a trait.

Fix #25
@theredfish theredfish merged commit 0a2a6e5 into main Mar 28, 2023
6 checks passed
@theredfish theredfish deleted the feat/json-path branch March 28, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant