test/ruby/test_refinement.rb: Prevent deprecation warnings during test
http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20211025T093004Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:777: warning: Refinement#include is deprecated and will be removed in Ruby 3.2 /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:840: warning: Refinement#prepend is deprecated and will be removed in Ruby 3.2 /home/chkbuild/chkbuild/tmp/build/20211025T093004Z/ruby/test/ruby/test_refinement.rb:2620: warning: Refinement#include is deprecated and will be removed in Ruby 3.2 ```
This commit is contained in:
parent
00c7b91f91
commit
7da9c25aa4
@ -747,6 +747,13 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.suppress_verbose
|
||||||
|
verbose, $VERBOSE = $VERBOSE, nil
|
||||||
|
yield
|
||||||
|
ensure
|
||||||
|
$VERBOSE = verbose
|
||||||
|
end
|
||||||
|
|
||||||
module IncludeIntoRefinement
|
module IncludeIntoRefinement
|
||||||
class C
|
class C
|
||||||
def bar
|
def bar
|
||||||
@ -774,7 +781,9 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
|
|
||||||
module M
|
module M
|
||||||
refine C do
|
refine C do
|
||||||
include Mixin
|
TestRefinement.suppress_verbose do
|
||||||
|
include Mixin
|
||||||
|
end
|
||||||
|
|
||||||
def baz
|
def baz
|
||||||
return super << " M#baz"
|
return super << " M#baz"
|
||||||
@ -837,7 +846,9 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
|
|
||||||
module M
|
module M
|
||||||
refine C do
|
refine C do
|
||||||
prepend Mixin
|
TestRefinement.suppress_verbose do
|
||||||
|
prepend Mixin
|
||||||
|
end
|
||||||
|
|
||||||
def baz
|
def baz
|
||||||
return super << " M#baz"
|
return super << " M#baz"
|
||||||
@ -2617,7 +2628,9 @@ class TestRefinement < Test::Unit::TestCase
|
|||||||
|
|
||||||
module D
|
module D
|
||||||
refine A do
|
refine A do
|
||||||
include B
|
TestRefinement.suppress_verbose do
|
||||||
|
include B
|
||||||
|
end
|
||||||
|
|
||||||
def foo
|
def foo
|
||||||
"refined"
|
"refined"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user