Avoid deprecation warnings in TestString

This commit is contained in:
Jean Boussier 2024-03-19 12:00:26 +01:00 committed by Jean Boussier
parent e5b585ba90
commit a008c56826

View File

@ -3629,6 +3629,9 @@ CODE
end end
def test_chilled_string_setivar def test_chilled_string_setivar
deprecated = Warning[:deprecated]
Warning[:deprecated] = false
String.class_eval <<~RUBY, __FILE__, __LINE__ + 1 String.class_eval <<~RUBY, __FILE__, __LINE__ + 1
def setivar! def setivar!
@ivar = 42 @ivar = 42
@ -3641,6 +3644,8 @@ CODE
ensure ensure
String.undef_method(:setivar!) String.undef_method(:setivar!)
end end
ensure
Warning[:deprecated] = deprecated
end end
private private