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
Not sure if we must specify the hash_including version to use each time, but researching a little bit it looks like WebMock version is stringifying the keys of the expected partial hash but Rspec version don't, so the error occurs once the key-to-key comparison is being made and do to different type of the keys, the response body returns nil for all keys since it's being query with symbol instead of string.
WebMock's version of hash_including has ben developed to cover hash_including in other environments than Rspec. When RSpec is used, default RSpec's hash_including is supposed to be used.
I guess the expected result is to have the first example pass.
Perhaps the keys should be stringified as well, before passing the hash to RSpec matcher, though these would have to be stringified in the nested hash_including's as well, which is tricky.
When using
hash_including
expectations don't pass at least I tell it explicitly to useWebmock::API.hash_including
.Those two version should pass but first one don't.
fails.rb
pass.rb
Not sure if we must specify the
hash_including
version to use each time, but researching a little bit it looks like WebMock version is stringifying the keys of the expected partial hash but Rspec version don't, so the error occurs once the key-to-key comparison is being made and do to different type of the keys, the response body returns nil for all keys since it's being query with symbol instead of string.webmock
webmock/lib/webmock/matchers/hash_argument_matcher.rb
Lines 5 to 8 in 382d84c
rspec
https://github.com/rspec/rspec-mocks/blob/0a52e0a86b126b4bab94d277b2ad99a7492dc37d/lib/rspec/mocks/argument_matchers.rb#L178-L181
The text was updated successfully, but these errors were encountered: