Closed bquorning closed 1 month ago
Nice!
can the failure be caused by some default TargetRubyVersion setting for that older RuboCop version? I guess we may have new syntax used in our specs, and conditionally enable those examples, but they won’t parse if the TargetRubyVersion won’t match the RUBY_VERSION. We have no need to test combinations of those two, right? We can just set the TRV to the RV.
~I guess we may be using a newer RUBY_VERSION than RuboCop can handle. E.g. if we use Ruby 3.3 and RuboCop 1.40 can only handle up to 3.1 or 3.2… Should we then rather test with the oldest Ruby that we support or the most recent Ruby that RuboCop supports?~
It turns out that the issue was fixed by adding :ruby27
metadata to the failing spec. RuboCop v1.40.0 used Ruby 2.6.0 by default when running specs: https://github.com/rubocop/rubocop/blob/v1.40.0/lib/rubocop/rspec/cop_helper.rb#L9
The problem is fixed; PR is ready for review.
Fixes: https://github.com/rubocop/rubocop-rspec/pull/1879#issuecomment-2107631095
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).