Match resources of unregistered types in getresources - #152
Open
stephanmoneybird wants to merge 1 commit into
Open
stephanmoneybird wants to merge 1 commit into
stephanmoneybird wants to merge 1 commit into
Conversation
Since fa5e689 a class from Generic.create is not registered, so decoding a reply gives every resource of that type a fresh class. extract_resources compared by class identity and dropped all of them, so getresources and each_resource returned nothing for types without a named class, such as NAPTR. Compare by type and class value as Message#== already does. Fixes ruby#151
This branch has not been deployed
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.
Fixes #151.
Since fa5e689,
Generic.createdoes not register its class, so decoding a reply gives each resource of an unregistered type a new class.extract_resourcesselected answers withwhen typeclass, which compares the class itself. Sogetresourcesandeach_resourcereturned nothing for types that have no named class, for example NAPTR.This change keeps the identity check and adds a comparison by type and class value, with
Generic.type_class_equal?.Message#==andGeneric#==already use this method since 05185b4. Named types behave as before:type_class_equal?returns false when a class is not aGeneric.The new test fails without the change. The full suite passes.