summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdouard CHIN <chin.edouard@gmail.com>2025-11-20 01:57:21 +0100
committergit <svn-admin@ruby-lang.org>2025-11-20 22:05:13 +0000
commit8b71234a4877b4bd2058cca2766ea9794fbcee41 (patch)
tree42956f0e89ec47d30bcccb769594d6fef21c5b29
parent409c004affa30efbbfd384a9cd645f7969ccc11a (diff)
[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
-rw-r--r--spec/bundler/commands/ssl_spec.rb9
1 files changed, 5 insertions, 4 deletions
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