Remove method redefinition warnings - #96
Merged
Merged
Conversation
Declare configuration accessors only when they do not have custom implementations. Remove duplicate delegations and isolate test doubles so the suite runs cleanly with Ruby warnings enabled.
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.
Running
bin/rake testonmastersucceeds, but emits 20 method redefinition warnings:The configuration warnings come from generating accessors that are subsequently replaced by custom implementations. Other warnings come from duplicate delegation declarations, test files sharing a top-level fake model, and a test restoring a temporarily replaced singleton method without first removing it.
Declare only the configuration accessors that do not already have custom implementations and remove the duplicate delegations while preserving the public configuration API. Give each test its own fake model and remove the temporary singleton method before restoring the original implementation.
Ruby warning mode remains enabled, and the suite now runs without redefinition warnings.