Open ecridge opened 6 years ago
@lingz one area I could use your input on is how to make sure that the output is still friendly when a response fails to match
Hey Joe,
Thanks a lot for this, I will do a full review tomorrow but cursory inspection looks good. A quick idea I have would be,
Attachment mismatch:
Expected: 2 Images, 1 Button
Got: No Attachments
Something like this might work?
This changeset allows responses to be checked for multiple attachments, sensitive to their number, order, and type. It also allows for the text body sent along with the attachments to be (optionally) checked just like it is for a plain response, and makes it trivial to add support for more attachment types in the future.
The YAML syntax is unchanged (save for the addition of an
<OTHER>
attachment type as a catch-all), and these changes should be fully backwards compatible. To achieve this, I made two compromises, which I think are fairly natural for users: (1) attachments must come at the end of the message spec; and (2) the text body of a response is not checked if the message spec consists only of attachments.