Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid arity check in Mock#respond_to_missing?
As far as I can see, Object#respond_to? has supported an optional 2nd argument since at least Ruby v1.8.6 and perhaps forever. The only thing thing that changed was that in Ruby v2 onwards the optional 2nd argument changed its name from include_private to include_all. I'm not sure whether this was just a clarification about the behaviour for protected methods or whether prior to v2 protected methods were never checked. In any case, it seems to make sense to assume that a respond_to? method always supports an optional 2nd argument and avoid the arity check in Mock#respond_to_missing?. My suspicion is that this check was only added to avoid having to fix some tests in MockTest which I've since resolved in an earlier commit.
- Loading branch information