You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trialled it as a replacement for exvcr. Unfortunately I don't think it will work for my use case currently. I have database records which are being auto-generated on each test run, and so they have different IDs on each run (as well as other randomly-generated data that differs on each run).
My code is passing these IDs into an external API which I'm stubbing with Walkman. Once I've recorded my tape on the first run, on the second run I get an error along the lines of: {:walkman_error, "replay found {...} didn't match given mfa {...} because those IDs don't match.
exvcr, and Ruby's vcr which it is based upon, handle this by configurable "request matching". By default they only match on the URI, so differing params don't cause a problem. Obviously Walkman knows nothing about URIs so this is not a direct option.
I guess I'd like to be able to configure some sort of "call matcher" for Walkman, and perhaps there would be an option to only match by function name/arity. So long as my tape is replayed with the function calls in the same order, Walkman would return the recorded return values. This would probably be sufficient for my use case.
I could also imagine some sort of configurable matcher function for custom logic.
I'm also keen to hear your thoughts about this use case and whether there are workarounds I haven't thought of.
The text was updated successfully, but these errors were encountered:
Thanks for Walkman! 🙇
I trialled it as a replacement for exvcr. Unfortunately I don't think it will work for my use case currently. I have database records which are being auto-generated on each test run, and so they have different IDs on each run (as well as other randomly-generated data that differs on each run).
My code is passing these IDs into an external API which I'm stubbing with Walkman. Once I've recorded my tape on the first run, on the second run I get an error along the lines of:
{:walkman_error, "replay found {...} didn't match given mfa {...}
because those IDs don't match.exvcr, and Ruby's vcr which it is based upon, handle this by configurable "request matching". By default they only match on the URI, so differing params don't cause a problem. Obviously Walkman knows nothing about URIs so this is not a direct option.
I guess I'd like to be able to configure some sort of "call matcher" for Walkman, and perhaps there would be an option to only match by function name/arity. So long as my tape is replayed with the function calls in the same order, Walkman would return the recorded return values. This would probably be sufficient for my use case.
I could also imagine some sort of configurable matcher function for custom logic.
I'm also keen to hear your thoughts about this use case and whether there are workarounds I haven't thought of.
The text was updated successfully, but these errors were encountered: