From 8b71234a4877b4bd2058cca2766ea9794fbcee41 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Thu, 20 Nov 2025 01:57:21 +0100 Subject: [ruby/rubygems] Change the logger instance for this spec: - With the logger change that is now threadsafe, such code no longer behaves the same: ```ruby Bundler.ui.silence do Bundler.ui.level = 'info' Bundler.ui.info("foo") # This used to output something. Now it doesn't. end ``` IMHO this is the right behaviour since we are in a silence block, changing the level should have no effect. And fortunately it seems that we only need to change this spec. The call to `Bundler.ui.silence` is done in a `around` block https://github.com/ruby/rubygems/blob/4a13684f07ebb1dea5501e3f826fab414f96bf47/bundler/spec/spec_helper.rb#L119 https://github.com/ruby/rubygems/commit/e716adb6c9 --- spec/bundler/commands/ssl_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/bundler/commands/ssl_spec.rb b/spec/bundler/commands/ssl_spec.rb index b4aca55194..4220731b69 100644 --- a/spec/bundler/commands/ssl_spec.rb +++ b/spec/bundler/commands/ssl_spec.rb @@ -16,16 +16,17 @@ RSpec.describe "bundle doctor ssl" do end end - @previous_level = Bundler.ui.level - Bundler.ui.instance_variable_get(:@warning_history).clear - @previous_client = Gem::Request::ConnectionPools.client + @previous_ui = Bundler.ui + Bundler.ui = Bundler::UI::Shell.new Bundler.ui.level = "info" + + @previous_client = Gem::Request::ConnectionPools.client Artifice.activate_with(@dummy_endpoint) Gem::Request::ConnectionPools.client = Gem::Net::HTTP end after(:each) do - Bundler.ui.level = @previous_level + Bundler.ui = @previous_ui Artifice.deactivate Gem::Request::ConnectionPools.client = @previous_client end -- cgit v1.2.3