[Rspecs] Make error message expectation more flexible in runner_spec.rb
to support Ruby 2.6 error message format
#21591
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.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
We recently merged #21587 into
trunk
, but while the CI was all green when it ran on the PR, it didn't run on Ruby 2.6 on macOS (because we intentionally disabled those to avoid running out of CI credits) and thus failed to detect a small glitch/difference in how Ruby 2.6 formats the error message we were testing in our Unit Tests (specs).As a result, CI started to fail on
trunk
after the PR landedDescription
That PR makes the
expect
of the offending tests more flexible in the way they check the expectedArgumentError
message, so that the tests can pass on every version of Ruby and be flexible enough to accommodate the different formats used by different Ruby versions for that error message.Testing Steps
rbenv local 2.6.6
(or make sure you use a Ruby version 2.6.x system-wide) then run the tests usingbundle exec rspec
.Note that CI won't run on { macOS + Ruby 2.6 } in the PR, so it won't be immediately obvious if we fixed that configuration. That being said, We still have some CI jobs that run 2.6 (especially on Linux and Windows) so those could be a way to check the behavior on Ruby 2.6, even if not on macOS.