-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
NoMethodError: undefined method `map' #443
Labels
Comments
I'm currently investigating. |
floehopper
added a commit
that referenced
this issue
Dec 16, 2019
This was highlighted when investigating this issue [1]. It turned out that this project was calling Expectation#multiple_yields with non-Array arguments, mostly/all Strings. See #443 for details. While the documentation said that each argument should be an Array, it turned out that in most cases the functionality still worked with non-Array arguments, but I suspect this was by accident rather than design. One exception to this was if an argument was a Hash, then it ended up being passed to the block as an Array of two-element Arrays. This code [2] which is used to optionally displays invocations was assuming that `yield_args` was always an Array, but this was not true. Similarly this code [3] which is used to display a deprecation warning was also assuming that `yield_args` was always an Array. And it was the latter which was causing the NoMethodError [4] in the apiology/quality project. I've hopefully fixed the underlying problem by wrapping any non-Array argument in an Array. Note that using Kernel#Array was not an option, because this didn't give the correct behaviour for Hash arguments. There is an argument to say that this was undocumented behaviour, but I think that seems unnecessarily strict in this case. [1]: apiology/quality#121 [2]: https://github.com/freerange/mocha/blob/1070fc02015a8ea36ad50782f80b557813595c02/lib/mocha/invocation.rb#L24 [3]: https://github.com/freerange/mocha/blob/1070fc02015a8ea36ad50782f80b557813595c02/lib/mocha/invocation.rb#L29 [4]: https://circleci.com/gh/apiology/quality/351
See possible fix in #444 |
Fixed in #444. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed this PR in which they tried to use v1.10.2 to fix the issue in #436, but ran into another problem.
The text was updated successfully, but these errors were encountered: