Repository navigation
Conversation
be_a_closure_tree.ordered(:column) stored the column in a misspelled instance variable (@order_colum) that was never read, so the matcher passed for any ordered model regardless of the column given.
yskttm
marked this pull request as ready for review
December 2, 2026 15:12
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.
What this fixes
be_a_closure_tree.ordered(:column)ignores the column, so it passes for a tree ordered by any column:matches?has never compared the column. Since the matcher was added in 6f14804,orderedhas stored the argument in@order_colum(missingn), which nothing reads.The fix
@order_column._ct.order_columnand fail withexpected Metal to be ordered by value, but it is ordered by sort_order. A string or a symbol works, andorderedwith no argument behaves as before.Testing
ordered matcher checks the given order columntotest/closure_tree/matcher_test.rb. It runs the matcher itself, since the existing tests use a localassert_closure_treehelper. It fails on master and passes with the fix.