Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error checking doesn't recognize hashes and provide the intended help #1020

Open
jakerobb opened this issue Mar 14, 2023 · 1 comment
Open

Comments

@jakerobb
Copy link

jakerobb commented Mar 14, 2023

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. 🙂

@bblimke
Copy link
Owner

bblimke commented Feb 20, 2024

Thank you @jakerobb

This is now fixed in 3.21.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants