Define traverse methods in proper context#36
Open
mcountis wants to merge 1 commit intowaterlink:masterfrom
Open
Define traverse methods in proper context#36mcountis wants to merge 1 commit intowaterlink:masterfrom
mcountis wants to merge 1 commit intowaterlink:masterfrom
Conversation
I'm guessing the original intent of the blocks provided to MatcherFactory were to mimic blocks provided to RSpec::Matchers.define calls. In that spirit, evaluate the provided block in the module context of RSpec's original matcher definition method so that any methods defined within the block are defined on the module/class rather than in a main/global context. This alleviates warning messages about the traverse method already being defined in the context and getting redefined.
Author
|
@waterlink / @alex-fedorov, do you still manage this repo? If not, have you any thoughts about passing it on to another user? |
5 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In the same spirit as how
RSpec::Matchers::defineevaluates given blocks in the context of a class/module, evaluate blocks given toRSpec::JsonExpectations::MatcherFactory#define_matcherin the same manner. Any methods defined in the given block will be defined as instance methods on the newMatcherrather than in a main/global context.Partially addresses #28 (warnings about
#traversegetting redefined).