From f1bf31d33b732f94993f14cb94008a73f3352c38 Mon Sep 17 00:00:00 2001 From: Herwin Date: Tue, 2 Dec 2025 12:45:19 +0100 Subject: [PATCH] Fix variable name for value of Warning[:strict_unused_block] This was probably copy-pasted from Warning[:experimental] --- core/warning/warn_spec.rb | 8 ++++---- language/method_spec.rb | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/warning/warn_spec.rb b/core/warning/warn_spec.rb index 1267734987..2e4a822e02 100644 --- a/core/warning/warn_spec.rb +++ b/core/warning/warn_spec.rb @@ -99,14 +99,14 @@ def Warning.warn(msg) ruby_version_is "3.4" do it "warns when category is :strict_unused_block but Warning[:strict_unused_block] is false" do - warn_experimental = Warning[:strict_unused_block] + warn_strict_unused_block = Warning[:strict_unused_block] Warning[:strict_unused_block] = true begin -> { Warning.warn("foo", category: :strict_unused_block) }.should complain("foo") ensure - Warning[:strict_unused_block] = warn_experimental + Warning[:strict_unused_block] = warn_strict_unused_block end end end @@ -137,14 +137,14 @@ def Warning.warn(msg) ruby_version_is "3.4" do it "doesn't print message when category is :strict_unused_block but Warning[:strict_unused_block] is false" do - warn_experimental = Warning[:strict_unused_block] + warn_strict_unused_block = Warning[:strict_unused_block] Warning[:strict_unused_block] = false begin -> { Warning.warn("foo", category: :strict_unused_block) }.should_not complain ensure - Warning[:strict_unused_block] = warn_experimental + Warning[:strict_unused_block] = warn_strict_unused_block end end end diff --git a/language/method_spec.rb b/language/method_spec.rb index 39b245fe2a..8f72bd45ed 100644 --- a/language/method_spec.rb +++ b/language/method_spec.rb @@ -1621,12 +1621,12 @@ def m_that_does_not_use_block # ensure that warning is emitted -> { m_that_does_not_use_block { } }.should complain(verbose: true) - warn_experimental = Warning[:strict_unused_block] + warn_strict_unused_block = Warning[:strict_unused_block] Warning[:strict_unused_block] = false begin -> { m_that_does_not_use_block { } }.should_not complain(verbose: true) ensure - Warning[:strict_unused_block] = warn_experimental + Warning[:strict_unused_block] = warn_strict_unused_block end end @@ -1635,14 +1635,14 @@ def m_that_does_not_use_block 42 end - warn_experimental = Warning[:strict_unused_block] + warn_strict_unused_block = Warning[:strict_unused_block] Warning[:strict_unused_block] = true begin -> { m_that_does_not_use_block { } }.should complain(/the block passed to 'm_that_does_not_use_block' defined at .+ may be ignored/) ensure - Warning[:strict_unused_block] = warn_experimental + Warning[:strict_unused_block] = warn_strict_unused_block end end end