[rb][spec] ruby3.2: redirect stdout directly instead of using Logger.… #11499
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.
…reopen
In selenium rb rspec test suite, rspec mocks
File.exist?
method partway. With ruby3.2, this may confuse::Logger.new
using$stdout
as output because ofIO
class being changed to accept#path
method. Then it may close$stdout
with::Logger.reopen
viahave_deprecated
rspec matcher defined in selenium internally.So when using have_deprecated matcher defined inside selenium, instead of using Logger.reopen, redirect stdout directly, using
Tempfile
and reopen$stdout
directly.Also, as said above, with ruby 3.2
IO
also accepts#path
method, soIO#path.exists?
is now valid on ruby3.2. This affects 'uses the given jar file and port' testsuite in spec/unit/selenium/server_spec.rb:File
class must be mocked so that#exist?
method accepts also '` argument.Closes #11498 .
Types of changes
Checklist