webmock
webmock copied to clipboard
Error checking doesn't recognize hashes and provide the intended help
If you pass a hash as a mocked response, the assert_valid_body! method fails to recognize it as such, and so you get the less helpful version of the error message.
I believe that this line should be changed from:
if @body.class.is_a?(Hash)
to:
if @body.is_a?(Hash)
@body is a Hash, but @body.class is a Class. 🙂
Thank you @jakerobb
This is now fixed in 3.21.2 release.