summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2024-03-19 12:00:26 +0100
committerJean Boussier <jean.boussier@gmail.com>2024-03-20 12:20:02 +0100
commita008c568262b7ea968755b5dfd3f09dc17f952a0 (patch)
treeb12594a42d6dc780d1b2e61ead464fcaece1b8e7
parente5b585ba908d371c67d97988795a5e40ec2f9e93 (diff)
Avoid deprecation warnings in TestString
-rw-r--r--test/ruby/test_string.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb
index 3f1b91a6a9..8df6d3277f 100644
--- a/test/ruby/test_string.rb
+++ b/test/ruby/test_string.rb
@@ -3629,6 +3629,9 @@ CODE
end
def test_chilled_string_setivar
+ deprecated = Warning[:deprecated]
+ Warning[:deprecated] = false
+
String.class_eval <<~RUBY, __FILE__, __LINE__ + 1
def setivar!
@ivar = 42
@@ -3641,6 +3644,8 @@ CODE
ensure
String.undef_method(:setivar!)
end
+ ensure
+ Warning[:deprecated] = deprecated
end
private