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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble understanding match_expected & match_actual #93

Open
vjster opened this issue Apr 13, 2016 · 2 comments
Open

Trouble understanding match_expected & match_actual #93

vjster opened this issue Apr 13, 2016 · 2 comments

Comments

@vjster
Copy link

vjster commented Apr 13, 2016

Hi Seth,
First of all, this is not an issue. I do not know how to get in touch with the developers of airborne and that's why raising my concern here.

I've been going through the airborne documentation and having difficulty understanding stuff.
Not completely understanding the match_expected & match_actual options provided within the tool.

It would be of great help if you could update the documentation with some real-time example.

Also is it possible to use expect_json just for a few values rather than check the whole json response.

I'm currently faced with a situation where few keys of api have values that continuously change and so I want to omit those keys from the expect_json data. How can I do that??

Thanks in advance,
VJ

@sethpollack
Copy link
Collaborator

It is a way to control how we compare the expected JSON with the actual JSON.

match_expected requires all the keys in the expected JSON are present in the response.
match_actual requires that the keys in the response are tested in the expected Hash.

So now you can do the following combinations

match_expected=false, match_actual=false - check only intersection
match_expected=false, match_actual=true - raise on extra key in response
match_expected=true, match_actual=false - raise on missing key in response
match_expected=true, match_actual=true - expect exact match

@sethpollack
Copy link
Collaborator

The match_expected_default and match_actual_default are for setting those options globally. The match_expected and match_actual are for changing the settings individually in test blocks.

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

No branches or pull requests

2 participants