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
So I have just discovered a few oddities in the way Webmock matches request bodies, since I have already had to delve into internals I will use internal API for demonstration too:
In other words - body matching algorithm [1] seems surprising to me, i.e. stubbed and actual bodies should have the same size, but then having different keys in stubbed and actual is accepted. If we agree that this should be changed, my proposition would be to compare actual keys, not the sizes of the both bodies.
So I have just discovered a few oddities in the way Webmock matches request bodies, since I have already had to delve into internals I will use internal API for demonstration too:
In other words - body matching algorithm [1] seems surprising to me, i.e. stubbed and actual bodies should have the same size, but then having different keys in stubbed and actual is accepted. If we agree that this should be changed, my proposition would be to compare actual keys, not the sizes of the both bodies.
[1] https://github.com/bblimke/webmock/blob/master/lib/webmock/request_pattern.rb#L224
The text was updated successfully, but these errors were encountered: