mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
Avoid deprecation warnings in TestString
This commit is contained in:
parent
e5b585ba90
commit
a008c56826
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue