Fix regression in Mock#responds_like behaviour #583
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The regression was inadvertently introduced in this commit and indirectly led to this issue.
I've attempted to thoroughly characterise the pre-regression behaviour of
Mock#responds_like
in a new acceptance test,RespondsLikeTest
, in order to reduce the chances of any such regressions occurring in the future. I've also added another acceptance test,ArrayFlattenTest
, which reproduced the issue until the regression was fixed.Investigating this has made me realise that the behaviour of
Mock#responds_like
in combination with protected & private methods on the responder was not specified in the documentation. I've attempted to reverse engineer the documentation so that it more fully describes the pre-regression behaviour.Note that the CI build for Ruby v1.9 is using an old version of Minitest which doesn't work with the
RespondsLikeTest
and since support for Ruby v1.9 was dropped in Mocha v2, I don't think it's worth the effort to sort this out so I've just disabled the test for Ruby v1.9.