-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression when stubbed method invoked with no args
In this commit [1] which was part of #660 and was released in v2.4.3, the new code didn't take into account that the `parameter` local variable in `HasEntries#matches?` can be `nil` if the stubbed method expects a `Hash` or keyword arguments but is called with no arguments. Previously this wasn't a problem, because the `nil` was handled by this guard condition [2] in `HasEntry#matches?`. However, now we're calling `#length` on `parameter` when `exact` is `true`, we need this new guard condition in `HasEntries#matches?`. [1]: 5e6a07b [2]: https://github.com/freerange/mocha/blob/e95fda25c41faaa4a7737b62a471544c5c2ddf2f/lib/mocha/parameter_matchers/has_entry.rb#L68
- Loading branch information
1 parent
e95fda2
commit 869c24e
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters