Small update to "verbose linting" spec to allow for Ruby 3.4 backtrace changes#1731
Merged
neilvcarvalho merged 1 commit intothoughtbot:mainfrom Feb 3, 2025
Merged
Conversation
… 3.4
- file: spec/acceptance/lint_spec.rb:188
Ruby 3.4 backtrace locations now include the object name
as well as the method name.
So "...`save!`" in 3.3, becomes "...'InvalidThing#save!'" in 3.4
The solution was to update the test regex to allow for either option:
%r{#{__FILE__}:\d*:in ('InvalidThing#save!'|`save!')}
neilvcarvalho
approved these changes
Feb 1, 2025
Member
neilvcarvalho
left a comment
There was a problem hiding this comment.
TY! I was going to add this as an issue as I didn't have time to investigate yesterday, and forgot. This unlocks adding Ruby 3.4 to the test matrix, which I was trying to add initially.
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.
Update for testing in Ruby 3.4
THE PROBLEM THIS FIXES
Ruby 3.4 backtrace locations now include both the object and method names in the format:
"<object_name>#<method_name>.
So a backtrace location with "...
save!" in ruby 3.3, now becomes "... 'InvalidThing#save!'" in Ruby 3.4.THE SOLUTION
The solution was to update the test regex to allow for either option:
%r{#{FILE}:\d*:in ('InvalidThing#save!'|`save!')}