airborne icon indicating copy to clipboard operation
airborne copied to clipboard

Trouble understanding match_expected & match_actual

Open vjster opened this issue 9 years ago • 2 comments

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

vjster avatar Apr 13 '16 14:04 vjster

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 avatar Apr 13 '16 14:04 sethpollack

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.

sethpollack avatar Apr 13 '16 14:04 sethpollack